Cartesian coordinates question



I graduated college over 12 years ago and my math is very rusty. I
write business software for a living, but lately I have become
interested in a pet programming project (a mix between genetics and AI)
that involves simple graphics using a cartesian coordinate system.
However, I've become stumped on a mathematics problem:

If I know a point (a,b), and I know a point (c,d), how do I determine a
point (x,y) that is I know is L units away and I know is at an angle of
rotation Z (USING (c,d) as the relative 0 degrees)? If I know every
value except x,y, how do I solve for x,y?

For example, let's say my first point is (50,50), my second point is
(100,100), the length L is 70.71 and the angle of rotation is 180. The
x,y would be 0,0. I just know that intuitively because from the
standpoint of 50,50, I know that 0,0 is certainly in the opposite
direction 100,100. I also know using Pythagorean's Theorem that (0,0)
is 70.71 units away from (50,50).

However, if point (a,b) was (46,29) and point (c,d) was (90,2) and the
angle of rotation was 145 degrees and the length was 20, I would have
no idea how to determine the x,y.

I have a diagram online but I am not sure if the newsgroup client I am
using (google) will cut off the url so I will write it like this:
wwwDOTvazkorDOTcom/coords.gif

Thanks so much for any help anyone can provide. Ideally, I would love
a formula where I can plug in numbers to get an x value, and another
formula where I can plug in values to get a y value.

Thanks again.

-Aaron

.



Relevant Pages


Quantcast