1. Math question
- Posted by PatRat <patrat at GEOCITIES.COM> Jan 19, 1998
- 694 views
Hello, I need to know what the cordinates X,Y are giving that the are P pixels away and D Degrees clockwise from N,I. Thanks :). --PatRat (Thomas Parslow) -- ()___() -- (o o) -- =\O/= -- Rat Software -- http://www3.mistral.co.uk/billparsl/
2. Re: Math question
- Posted by Mike Burrell <mikpos at SOFTHOME.NET> Jan 19, 1998
- 690 views
PatRat wrote: > Hello, > I need to know what the cordinates X,Y are giving that the are P > pixels away and D Degrees clockwise from N,I. > Thanks :). -- first let's convert D to radians with the function constant pi = 3.141592653589 function deg2rad(atom d) return d / 180 * pi end function -- wewp wewp okay now i'm assuming that 0 degrees (or radians now) means -- it's to the right, and pi / 2 would be up, pi would be left, etc. function where_coords(atom P, atom D) D = deg2rad(D) -- unless you've already done this y = -P * sin(D) -- negative becos in gfx, -y is up -- whereas in trig, -y is down :\ x = p * cos(D) end function -- w00p it's been quite a while since i've taken math...i guess trig sticks -- to ya...i wonder if that's a good thing :\ -- Mike Burrell http://mikpos.home.ml.org/ mikpos at softhome.net