AER to ECI transformation

With a little help from chatGPT I cobbled together a complete example that might be what I need? Attached is my complete example code but the main functionality comes from this method.

 private static PVCoordinates aerToECI(AbsoluteDate date, double observerLatitude, double observerLongitude,
                                          double observerAltitude, double azimuth, double elevation, double range) {
        // Define the Earth ellipsoid (WGS84 in this case)
        OneAxisEllipsoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS,
                Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));

        // Create a TopocentricFrame for the observer location
        GeodeticPoint observerLocation = new GeodeticPoint(observerLatitude, observerLongitude, observerAltitude);
        TopocentricFrame topocentricFrame = new TopocentricFrame(earth, observerLocation, "ObserverTopocentricFrame");

        // Transform AER to ECI coordinates
        PVCoordinates pvECI = topocentricFrame.getTransformTo(earth.getBodyFrame(), date)
                .transformPVCoordinates(new PVCoordinates(new Vector3D(range * Math.cos(elevation) * Math.sin(azimuth),
                        range * Math.cos(elevation) * Math.cos(azimuth), range * Math.sin(elevation)),
                        new Vector3D(0, 0, 0)));  // Velocity is assumed to be zero in this example

        return pvECI;
    }

Is this even close? It seems like the post you reference, but way more verbose.

TopocentricToECIExample.java (4.0 KB)