# convert 1 vector and 1 angle to 3 vectors and 3 angles ll quaternion to latitude,long

This topic is 4069 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

hello, I would like to know how to convert a vector and an angle like (Vector3D(0.8,0.5,-0.9),0.65) 0.65 //is the angle to three vector like that Vector3D(1,0,0),angle_x Vector3D(0,1,0),angle_y Vector3D(0,0,1),angle_z i try to use porportion but that doesn't work, thanks for any help ! [Edited by - cbastien on May 29, 2007 2:08:40 AM]

##### Share on other sites
Your question is not very well defined. I assume you want to convert an axis-angle pair into Euler angles. This is complicated by the fact that we do not know what Euler angle convention you are using. See here for guidance.

##### Share on other sites
It almost seems like you wish to write an arbitrary 3D vector in terms of some orthogonal basis {v1,v2,v3} of R^3? I am not certain what the angle is for?

Let u = (x_1,x_2,x_3) then (u . v1/(v1.v1))v1 + (u . v2/(v2.v2))v2+ (u . v3/(v3.v3))v3 is the linear combination you seek? It is quite a bit more involved if you do not already have the orthogonal basis.

The angle u makes with each of the axes is acos(x_n/|u|) for n = 1,2,3

[Edited by - Daerax on May 25, 2007 12:16:54 PM]

##### Share on other sites

I'm using quaternion in my opengl program.

the camera is used to turn around a sphere.

I convert a latitude and longitude to a quaternion like this :

q1.AxisToQuat(Vector3D(0,1,0),longi);
q2.AxisToQuat(Vector3D(1,0,0),lati);
camera_quat=q1*q2;

Now i would like to do the opposite computation, i mean find a latitude and longitude from a quaternion.

[Edited by - cbastien on May 28, 2007 5:49:01 AM]

1. 1
Rutin
23
2. 2
3. 3
JoeJ
20
4. 4
5. 5

• 29
• 40
• 23
• 13
• 13
• ### Forum Statistics

• Total Topics
631739
• Total Posts
3001958
×