[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] how to "think rotation" on a longitude-latitude reference system ?



Greg, Michael, René,

thanks infinite for your hints, 

i'm not yet able to give you feedback in the form of code :-/

the code is a bit complex "for me" so i'm studing your wonderfull suggestion!

right now i'm here http://code.google.com/p/pyeuclid/ 
i installed the library and i'm doing a "depth" lecture of the site :
http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/index.htm

it's a wonder-complex word, my background don't give me the ability to code it for now.
Reading your hints i can see that i can follow different procedure to ontain the same results,
i need to strat to study the problem, in theory i've idea on what a quaternion is and its math properties
but is a bit hard to undstand how to code to perform a rotation.

to learn more maybe i need numerical examples, so now i'm creating 2 first function to :

transform lon-lat-heading to quaternion representation and viceversa from quaternion to euler angles.

something like :

euler2quat(lon,lat,heading)
quat2euler(q)  # where q = array((x,y,z,w),float)


btw, i'll continue to reading and study
tring to find a solution to a numerical example, like

start:
point_0 = 0,0,0 
- go ahead for  ( 0 degres_X ;  45 degres_Y )  (north direction) 
stop1 : position = point1

point_1 = 0,45,0
- rotate = 22.5° (NorthNorth East) and go ahead for ( 5 degres_X' ; 5 degres_Y' ) where X' and Y' are new axis " |_ "
point_2 = x,y,heading  <- unknow

* greg :


can you point me on example using that ethod ?

R should be a rotation matrix and a is an angle in radiants

i can create R following notes from : ?
http://www.euclideanspace.com/maths/geometry/rotations/conversions/eulerToMatrix/index.htm

Forward-back:     R' = Rx(a) * R
Left-right:       R' = Ry(a) * R
Change heading:   R' = Rz(a) * R

and then after compute the new R' i need to convert to euler using : ?

http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToEuler/index.htm

(but this method shoul'd be valid for point =! pole)


make sense what i wrote ?

thanks a billion to help me!!!

Ciao,

Massimo.