Shafique Jamal
Shafique Jamal

Reputation: 1688

How to find the GPS coordinates (latitude, longitude) of the foci of an ellipse?

How can one find the GPS coordinates (latitude, longitude) of the foci of an ellipse, given the center GPS coordinate, the tilt from the west, and the major and minor widths?

I have consulted the following:

How can I determine if a GPS Coordinate is on or in an Ellipse?

How to determine if a latitude & longitude is within an ellipse

And other sources that involve geometry but not GPS coordinates. The geometry sources are good for calculating the focii positions in a cartesian plane, but I've not found a solution with code to convert between GPS coordinates and cartesian coordinates in Scala (or Java).

So if the major axis is 4 km and the minor axis is 2 km, and the tilt is 20 degrees, how can I get the GPS coordinates of the foci? Thanks.

Update: In response to the comments, I would like to clarify that the dimensions of the ellipse are small enough that I can approximate the earth under the ellipse as being flat.

Upvotes: 1

Views: 1000

Answers (1)

Shafique Jamal
Shafique Jamal

Reputation: 1688

I think I got it. Given the lengths of the major axis and minor axes, the center point, and the angle from the north (bearing) of the ellipse, I can calculate the location of the focii as follows.

First, I can calculate distance from the center to either focus, using the formula available here:

d = srqt(|a*a - b*b|)

where d is the distance between the center and either focus, a a is the semi length of the major (minor) axis and b is the length of the minor (major) axis.

Second, since I have the angle from the north, I thus have the bearing, and can use that along with the distance to either focus to calculate the location of either focus, using the formula given under the section ... available here:

φ2 = asin( sin φ1 ⋅ cos δ + cos φ1 ⋅ sin δ ⋅ cos θ )
λ2 = λ1 + atan2( sin θ ⋅ sin δ ⋅ cos φ1, cos δ − sin φ1 ⋅ sin φ2 )

where φ is latitude, λ is longitude, θ is the bearing (clockwise from north), δ is the angular distance d/R; d being the distance travelled, R the earth’s radius.

For θ I would use the angle from the north to find the position of one focus, then I would use the angle from the north plus 180 degrees to find the other focus.

Upvotes: 0

Related Questions