this should help http://en.wikipedia.org/wiki/Spherical_coordinate_system
hth On 27 March 2010 09:12, dyc <[email protected]> wrote: > I kinda need to know how to do the opposite of that...I have an x,y,z > coordinate and I need to convert it to a lon/lat positon. > > Anyone know how to reverse this formula: > > X = R * sin(LAT) * sin(LNG); > Y = R * cos(LAT); > Z = R * sin(LAT) * cos(LNG); > > Thats pretty much what I need to do. =) > > Thanks so much for all the help so far guys! > > On Mar 24, 5:35 am, Plopsi <[email protected]> wrote: > > hi, imho you justed swapped some axis, here is a snippet from my lat/ > > long stuff: > > > > m_PositionBubble[i].x = 200 * Math.sin(Deg2Rad(90-m_Bubble[i]._lat)) * > > Math.sin(Deg2Rad(m_Bubble[i]._lng+90)); > > m_PositionBubble[i].y = 200 * Math.cos(Deg2Rad(90-m_Bubble[i]._lat)); > > m_PositionBubble[i].z = 200 * Math.sin(Deg2Rad(90-m_Bubble[i]._lat)) * > > Math.cos(Deg2Rad(m_Bubble[i]._lng+90)); > > > > so > > > > X = R * sin(LAT) * sin(LNG); > > Y = R * cos(LAT); > > Z = R * sin(LAT) * cos(LNG); > > > > look if you have to do this 90-LAT and LNG+90 thing, i'm not sure > > about that at the moment if it is only a fix for my angles. > > > > Plopsi > > > > On 12 Mrz., 07:15, dyc <[email protected]> wrote: > > > > > Hey guys, > > > > > I am currently trying to go from an XYZ coordinate to a lon/lat > > > coordinate. > > > > > The formula to go from lon/lat to XYZ is as follows: > > > > > LAT = latitude * pi/180 > > > LON = longitude * pi/180 > > > x = -R * cos(LAT) * cos(LON) > > > y = R * sin(LAT) > > > z = R * cos(LAT) * sin(LON) > > > > > Can anyone help me figure out how to reverse that formula so I can get > > > lon/lat from xyz? > > > > > Thanks so much! > > > > > `Scott > > To unsubscribe from this group, send email to away3d-dev+ > unsubscribegooglegroups.com or reply to this email with the words "REMOVE > ME" as the subject. > -- katopz http://www.sleepydesign.com To unsubscribe from this group, send email to away3d-dev+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
