Elevation angle between positions

I use Java NASA WorldWind, and I have two objects with different marks and positions.

How can I find the elevation angle between objects taking into account the curvature of the earth?

This image illustrates (obviously not to scale) what I'm trying to do:

enter image description here

Object A is 50 feet above the ground, and Object B is 500 feet above the ground. How can I find Angle X, taking into account the curvature of the earth?

+4
source share
2 answers

Trigonometry saves a day! Please refer to this messy diagram when I work with the answer:

enter image description here

, , α. θ, ( ) (, , , ). L, θ L/R (. ), R - .

d 1, d 2 d 3. α, d 2 d 3, (θ + α) d 2/d < > 3 > . , ?

d 1. , d 1 d 3 R + h a, A. , d 1:

enter image description here

, d 3:

enter image description here

, d 2? , R + h b; , B. d 1. , d 2:

enter image description here

α:

enter image description here

, , , α. α, , ; - , ! , , , - .

+5

WorldWind API. , , :

import gov.nasa.worldwind.BasicModel;
import gov.nasa.worldwind.WorldWindow;
import gov.nasa.worldwind.awt.WorldWindowGLCanvas;
import gov.nasa.worldwind.geom.Angle;
import gov.nasa.worldwind.geom.Position;

public class ElevationAngle {

    static WorldWindow ww = new WorldWindowGLCanvas();

    static {
        ww.setModel(new BasicModel());
    }

    public static void main(String[] args) {

        Position pos1 = new Position(Angle.fromDegrees(34.22389),
                Angle.fromDegrees(117.2458), 50 * 0.3048); //elevation in meters

        Position pos2 = new Position(Angle.fromDegrees(34.22389),
                Angle.fromDegrees(117.2440), 500 * 0.3048); //elevation in meters

        System.out.println(getElevationAngleDegrees(pos1, pos2));
    }

    public static double getElevationAngleDegrees(Position pos1, Position pos2) {

        double R = ww.getModel().getGlobe().getRadiusAt(pos1);

        double L = Position.greatCircleDistance(pos1, pos2).getRadians() * R;

        double theta = L / R;

        double ha = pos1.getElevation();

        double hb = pos2.getAltitude();

        double d1 = (R + ha) * Math.cos(theta);

        double d3 = (R + ha) * Math.sin(theta);

        double d2 = R + hb - d1;

        double alpha = Math.atan(d2 / d3) - theta;

        return Math.toDegrees(alpha);

    }

}
+1

Source: https://habr.com/ru/post/1584580/


All Articles