Jump to content

[SOLVED] Problem with conversion to WGS with Geodetic


photo

Recommended Posts

Hello
 

Test code:

g = new Unigine::Geodetic();
g.radius_a = 100;

// a - ECF dvec3 vector
dvec3 b = g.WGSToECF(g.ECFToWGS(a));

log.message(string(a));
log.message(string(b));

 
Result:
4.5197 -8.45577 99.2056
4.5197 -8.45577 105.983
 
Why did double conversion to WGS and back change value so much? And why did it change only z coord?

Link to comment

Hi there!

 

It's not enough just to change one radius, you'll also have to recalculate all corresponding values such as eccentricity and flattening. So if you want to use WGS84 coordinates for another geoid then you need to adjust the formula.

 

If you still want to use it for Earth then don't change the values as they're precalculated for Earth. Also, this conversion has an error so in order to reduce it you can choose WGS origin close to your ECF point.

Link to comment
  • 2 weeks later...
×
×
  • Create New...