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

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




Massimo Di Stefano wrote:
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

Massimo,

The Quaternion class in pyeuclid contains methods to convert to and from euler angles and matrices (see rotate_euler, get_euler, new_rotate_euler and similarly for _matrix and _axis_angle). For some reason these aren't in the docs, but you should be able to use them and/or study them.

--Mike