Registered Member
|
I have two object locations: A vehicle location, given in latitude/longitude/altitude, and an object detected by the vehicle, given as an X/Y/Z offset from the vehicle in meters. Using this information, does Marble have the faculties to get the latitude/longitude/altitude of the detected object?
I would like to use GeoDataCoordinates to hold both of these locations so I can paint them on the map, but I don't see any functions to help me turn the offsets into a GeoDataCoordinates. I would appreciate any assistance! |
KDE Developer
|
There's no ready-made function, but the math behind it should look like below, with the input being
Output is lon2, lat2, alt2 See also http://www.movable-type.co.uk/scripts/latlong.html |
Registered Member
|
Earthwings, I apologize, I neglected to check the "notify me" box! Thank you very much for your prompt response .
I realize that I left one specification out: I said the x/y/z was offset from the vehicle in meters, but it's actually in north/east/up, which simplifies things a bit. Combining that with your solution, my code looks like the following:
It seems to work well. How does it look? |
Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell