PDA

View Full Version : convert relative to global


mamali
Sep2-09, 12:49 PM
could any one help me ?
i know global position of three flag for example (10,20,30)
and i have my distance , phi and theta to flags .
could any one helping me find my position ?

HallsofIvy
Sep3-09, 06:26 AM
What do you mean by "three flags"? You give the position, (10, 20, 30) of one point. But knowing the coordinates of a single point and your position relative to that point is sufficient. Your x, y, z coordinates, taking that one point as origin are x= \rho cos(\theta) sin(\phi), y= \rho sin(\theta) sin(\phi) and z= \rho cos(\phi). Your x, y, z "global" coordinates, relative to the same coordinate system in which your point is (10, 20, 30) are x= \rho cos(\theta) sin(\phi)+ 10, y= \rho sin(\theta) sin(\phi)+ 20 and z= \rho cos(\phi)+ 30, a simple translation.

I am assuming here that your "\theta" and "\phi are relative to the "global" coordinate system. If not, you might need three points and would need to specify how \theta and \phi are measured.