Click to See Complete Forum and Search --> : [SOLVED] Someone please figure this out.
Q_Me
Sep 27th, 2004, 02:43 PM
I made it in Geo-SketchPad to give an idea to my delima. :confused: I don't know how to find G or P when it is rotated to the given angle of m<roa
Someone help, I need an equation so I can put it into VB, and translate the points to a given angle.
Q_Me
Sep 27th, 2004, 02:45 PM
http://www.vbforums.com/attachment.php?s=&postid=1799091
jemidiah
Sep 28th, 2004, 12:42 AM
For G...
Think in Polar mode, rotation is easy there.
m(angle)Goa = 90 + 57 = 147. So theta is 147 degrees, and r (radius) is d, 224.84 px. Translating from Polar to Rectanglular gives x = rcos(theta), y = rsin(theta) or
x = 224.84*cos(147 deg)
x = -188.57 px
y = 224.84*sin(147 deg)
y = 122.46 px
G = (-188.57, 122.46)
Now, the others are more difficult.... lemme think on P
We need r and theta. For r, we can simply use the Pythagorean Theorem.
n2 + lo2 = r2
r = sqrt(n2 + lo2)
r = sqrt(59.022 + 91.672)
r = 109.03 px
Theta is a bit more difficult, though we can use the nice fact that the angle Gol is known and we have Trig functions.
m(angle)Poa = m(angle)loa - m(angle)Pol
m(angle)Poa = m(angle)Goa + 90 - m(angle)Pol
m(angle)Poa = m(angle)Roa + 90 + 90 - m(angle)Pol
m(angle)Poa = 57 + 90 + 90 - m(angle)Pol
m(angle)Poa = 237 - m(angle)Pol
----tan(m(angle)Pol) = n/lo
----m(angle)Pol = atan(n/lo) 'atan = inverse tangent; arctangent (not 1/tan(x))
----m(angle)Pol = atan(59.02/91.67)
----m(angle)Pol = atan(0.6438)
----m(angle)Pol = 32.77 deg
m(angle)Poa = 237 - 32.77
m(angle)Poa = 204.23 deg
Now that we have r and theta, plug in as before
x = 109.03*cos(204.23 deg)
x = -99.43 px
y = 109.03*sin(204.23 deg)
y = -44.75 px
P = (-99.43 px, -44.75 px)
Now, finally, slope is simple.
Py - Gy
-------
Px - Gx
M = -167.21/89.14
M = -1.876
To summarize,
G = (-188.57, 122.46)
P = (-99.43 px, -44.75 px)
M = -1.876
I do truly hope my math is right, but the reasoning is sound. Good luck!
Q_Me
Sep 28th, 2004, 01:26 AM
:eek2:
I find that facinating. Do you have a 1 or 2 line expression to solve each points with given Theta? In other words, instead of plugging in the numbers, like you so nicely did :cool: , use variables. Because I don't see the numbers, I evaluate the expressions.
Other than that. WOW :eek:
alkatran
Sep 28th, 2004, 07:06 PM
If you know l, o and n you can find P
Find the angle from l to o, add 90, and extend a line of n length in that direction to get P.
Now since you know d is parrallel to n, you can find G too.
With G and P you can find m
etc
These kinds of problems are all about finding ONE thing. Then it's a big domino effect.
jemidiah
Sep 30th, 2004, 07:15 PM
G(x, y)
x = d*cos(90 + m(angle)Roa)
y = d*sin(90 + m(angle)Roa)
P(x, y)
x = sqrt(n2 + lo2)*cos(m(angle)Roa + 180 - atan(n/lo))
y = sqrt(n2 + lo2)*sin(m(angle)Roa + 180 - atan(n/lo))
M
Py - Gy
-------
Px - Gx
(sqrt(n2 + lo2)*sin(m(angle)Roa + 180 - atan(n/lo)) - d*sin(90 + m(angle)Roa))
------------------------------------------------------------------------------
(sqrt(n2 + lo2)*cos(m(angle)Roa + 180 - atan(n/lo)) - d*cos(90 + m(angle)Roa))
Note: All trig functions are in degrees. If you need Radians (VB uses them) you need to multiply the argument in Sine and Cosine by Pi / 180 = 3.14159265 / 180 = 0.0174532925
Q_Me
Oct 1st, 2004, 10:08 AM
Awesome. I'll check the math when I get to my evening class to use GeoSketch.
:D
wossname
Oct 1st, 2004, 03:39 PM
Jesus Christ! This is the scariest thread I have ever seen :D Not seen so much algebra since I nailed the Nuclear and Particle Physics module exam of my A-Levels.
Respect.
Q_Me
Oct 1st, 2004, 03:55 PM
Is there a subistute for atan? I found "G" easily. But I relized the troubles with "atan" in previous applications I have made due to the "reversal" way of plotting points. So is there a way to just use Sine and Cosine instead of Atan in the usage of finding point P?
alkatran
Oct 2nd, 2004, 07:04 PM
What in the world are you talking about with atan being reversed?? :confused:
jemidiah
Oct 2nd, 2004, 11:11 PM
http://mathworld.wolfram.com/InverseTangent.html
Number 19 gives a good definition in terms of inverse sine. I checked it in VB6.0 using their derived math function for inverse sine (Atn(X / Sqr(-X * X + 1))) and, if it was innacurate, it was only so by about 0.000000000000008 from the value given by straight inverse tangent. Hope that helps.
In terms of sine and cosine... I haven't been able to find a definition of atan in terms of either one. It would probably be easier to use one of the summation series given in that link on the top. They're ugly, but they sure should work.
btw wossname: :lol:
Q_Me
Oct 3rd, 2004, 01:58 PM
Awesome. :D Thanks.
Atan is sometimes used to plot points in reverse order of code.
eg. The most common rotation of rotating 4 vectors at a time. It finds the pixel at the specified rotation then plots it as normal as if it were a boxed picture.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.