Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elevation Angle between Positions [closed]

I'm using Java NASA WorldWind, and I have two objects with different elevations and positions.

How can I find the elevation angle between the 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?

like image 520
mainstringargs Avatar asked Apr 24 '15 22:04

mainstringargs


People also ask

How do you find the angle of elevation?

The following formula for the elevation angle at solar noon can be determined:α=90+φ−δα=90+φ-δwhere: φ is the latitude of the required location (positive for the northern hemisphere and negative for the southern hemisphere).

How do you solve angle of elevation problems?

tan θ = y/x; cot θ = x/y. depending upon the data given in the question, corresponding formula is applied to find out the angle of elevation. Here SR is the height of man as 'l' units and height of pole to be considered will be (h - l) units. The line of sight in this case will be PS and angle of elevation will be 'θ'.

What is elevation angle?

Definition of angle of elevation : the angle formed by the line of sight and the horizontal plane for an object above the horizontal.


2 Answers

Trigonometry saves the day! Please refer to this untidy diagram as I work through the answer:

enter image description here

The angle we want to find is α. We can easily find θ if we know the distance (along the curvature of the Earth) between the two points (or more accurately, the curved-line distance between the two points we get on the surface on the Earth, if we extend a line from each object down to the surface). If the distance is L, then θ is just L/R (see Arc Length) where R is the radius of the Earth.

Notice the values d1, d2, and d3. We can easily find α if we know d2 and d3, because (θ + α) is the inverse tangent of d2/d3. So how do we find these?

First we'll find d1. We know that the hypotenuse of the triangle with d1 and d3 is R + ha, which is just the radius of the Earth plus the elevation of object A. Hence we can find d1:

enter image description here

Similarly, for d3:

enter image description here

Now how do we find d2? We know that the total length of the base of the entire triangle is R + hb; essentially just the radius of the Earth plus the height of object B. We already know d1. So d2 is:

enter image description here

Now we are ready to find α:

enter image description here

So using this expression which is in terms of the heights of both objects and the radius of the Earth, you should be able to find α. There may be an even easier way to find α, but this is what I was able to come up with; it's been a while since I did any trigonometry! I think my math is correct, but let me know if you spot anything wrong.

like image 90
Vivin Paliath Avatar answered Oct 10 '22 21:10

Vivin Paliath


I took Vivin's answer and coded it into the WorldWind API. I think its working as I expect:

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);

    }

}
like image 37
mainstringargs Avatar answered Oct 10 '22 22:10

mainstringargs