# Transformation from Cartesian to geographic coordinates

I am trying to transform a point in geographic (lat, lon, alt) coordinates to Cartesian/EME2000 as ORaaS does. Doing the inverse, from Cartesian to LLA works as described here, and the result is in very close agreement with ORaaS. But “Transform a surface-relative point to a Cartesian point” `transform​(GeodeticPoint point)`, which would seem to be the inverse of the successful use of `transform​(Vector3D point, Frame frame, AbsoluteDate date)` “Transform a Cartesian point to a surface-relative point”, gives a very different answer than what I expect, and moreover takes neither the frame nor the `AbsoluteDate` as an argument, so seemingly it is not doing the transformation desired.

How do I get the LLA to Cartesian transformation as ORaaS computes it?

Hi Liam,

Using `transform(GeodeticPoint point)`, you get a point in the ITRF frame associated to the OneAxisEllipsoid.

To get the EME2000 coordinates at some `date`, you need to do the following (which is what ORaaS does):

1. Create the Earth model
``````OneAxisEllipsoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS,                                   Constants.WGS84_EARTH_FLATTENING,                                  FramesFactory.getITRF(IERSConventions.IERS_2010, false));
``````
1. Create the `GeodeticPoint` from latitude, longitude, altitude (beware `lat` and `lon` should be in radians, `alt` in meters)
``````GeodeticPoint point = new GeodeticPoint(lat, lon, alt);
``````
1. Create the TopocentricFrame for this point:
``````TopocentricFrame topoFrame = new TopocentricFrame(earth, point, "My Point");
``````
1. Apply the transform to get the position in EME2000:
``````Vector3D cartesianEme2000 = topoFrame.getPVCoordinates(date, FramesFactory.getEME2000()).getPosition();
double x = cartesianEme2000.getX();
double y = cartesianEme2000.getY();
double z = cartesianEme2000.getZ();
``````

Best regards,
Pascal

1 Like

Hello @pascal.parraud Thanks for the solution. This is really helpful for me.