LOGO
General Discussion Undecided where to post - do it here.

Reply to Thread New Thread
Old 12-23-2011, 08:58 PM   #1
Angelinaaiiiiiiiii

Join Date
Oct 2005
Posts
383
Senior Member
Default Equivalence of directions (a programming question)
Offhand I'd say that you would probably benefit from using polar coordinates instead of cartesian coordinates, but I haven't used polar coordinates with enough regularity to come up with an algorithm off the top of my head.
Angelinaaiiiiiiiii is offline


Old 12-23-2011, 09:41 PM   #2
maks_holi

Join Date
Oct 2005
Posts
523
Senior Member
Default
There's no way to do this without trig

The best way is via polar coords.

consider a direction as an iterative series of actions (turn plus step) on the following triplex: d,a,h

h is heading, d is distance from origin, a is angle of current position from x axis.

I will write out form of iteration when not on phone. Two directions are equivalent if their final triplexes match in d and a (h doesn't matter). Iteration involves law of sines and law of cosines.
maks_holi is offline


Old 12-23-2011, 10:25 PM   #3
paulaglober

Join Date
Oct 2005
Posts
357
Senior Member
Default
So the non-trig way to do it with pi/4 turns is a special case, the because the results of trig are rational at every step!?
paulaglober is offline


Old 12-24-2011, 08:11 PM   #4
RaicickKida

Join Date
Oct 2005
Posts
388
Senior Member
Default
You're building a new bar pickup line?
I'm happily married, thank you..
RaicickKida is offline



Reply to Thread New Thread

« Previous Thread | Next Thread »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

All times are GMT +1. The time now is 05:10 PM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 PL2
Design & Developed by Amodity.com
Copyright© Amodity