1

I am using Azimuthal Equidistant Projection to plot points in a map being drawn in an Android application.

The origin is the centre of the map.

I have the formulas from here and here. I am getting expected results.

Simplified version of the code being used by me in JavaScript:

// Add functions to Math
if (!Math.toRadians)
    Math.toRadians = function(angledeg) {
        return angledeg * Math.PI / 180;
    };
if (!Math.toDegrees)
    Math.toDegrees = function(anglerad) {
        return anglerad * 180 / Math.PI;
    };

/* Mean radius of Earth (in metres)*/
const WGS_1984_R = 6370997;

/* Function to convert geodetic coordinates to Azimuthal Equidistant Projection projection (cartesian metres)*/
function convertGeodeticToAEP(longitude, latitude, longitudeOrigin, latitudeOrigin) {
    var deltaLongitudes = Math.toRadians(longitude - longitudeOrigin),
            cosDeltaLongitudes = Math.cos(deltaLongitudes),
            cosLatitude = Math.cos(Math.toRadians(latitude)),
            sinLatitude = Math.sin(Math.toRadians(latitude)),
            cosLatitudeOrigin = Math.cos(Math.toRadians(latitudeOrigin)),
            sinLatitudeOrigin = Math.sin(Math.toRadians(latitudeOrigin)),
            // Angular distance from the centre
            c = Math.acos(sinLatitudeOrigin * sinLatitude + cosLatitudeOrigin * cosLatitude * cosDeltaLongitudes),
            k = c == 0 ? 0 : c / Math.sin(c),
            x = k * cosLatitude * Math.sin(deltaLongitudes) * WGS_1984_R,
            y = k * (cosLatitudeOrigin * sinLatitude - sinLatitudeOrigin * cosLatitude * cosDeltaLongitudes) * WGS_1984_R;
    return {x: x, y: y};
}

What would be the formulas to rotate the projection by a given angle, from the origin? Say modify the function to include an additional parameter for angle of rotation and then modify the output accordingly...

2
  • @whuber Unlike the answer (gis.stackexchange.com/questions/183175/…) mentioned, I am not using R or Proj4. So that does not answer my question...
    – Kanchu
    Apr 14, 2016 at 3:06
  • You asked for 'formulas". If you intended to ask for something else, then please edit your post.
    – whuber
    Apr 14, 2016 at 5:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.