2015 Jun 05
Abstract
Given the GPS coordinates of a user, the orientation of their camera, and the linear distance to the Point-of-Interest (POI) being photographed, we determine the GPS coordinates of the POI. We derive the analytical expressions that relate the input data to the POI coordinates for the most general case. Approximate forms of the equations are also derived, in two different ways, for the more common case of the POI in the immediate neighbourhood of the user.
Acknowledgements
This work was done in my spare time while employed by Motorola Mobility LLC, Chicago, Illinois - 60654, USA. It has been reproduced on this blog after receiving the appropriate Motorola Mobility internal publication clearance. This 'problem' was obliquely borne out of discussions with Vidyadhar Gurram. I subsequently cast it into symbolic form and derived the pertinent equations.1. Symbol glossary
Note: All distances are in metres and all angles are in radians. 'Sea level' is defined by the surface of the GPS reference ellipsoid.
Symbol
|
Description |
---|---|
User's longitude |
|
User's latitude |
|
User's height above sea level | |
Distance to the centre of the Earth from sea level at the user's position | |
Azimuth angle of the camera orientation measured due West of North and valid only when |
|
Zenith angle of the camera orientation |
|
Euclidean straight line distance from the camera to the target along the camera orientation vector | |
Target's longitude |
|
Target's latitude |
|
Target's height above sea level | |
Distance to the centre of the Earth from sea level at the target's position | |
Angular separation between the user and the target as seen from the centre of the Earth |
|
U | User (in figures) |
T | Target (in figures) |
N | North pole of the Earth (in figures) |
C | Centre of the Earth (in figures) |
2 Goal
Given the GPS coordinates ( , , ) of the user , the orientation of the user's camera, and the distance to the target being photographed, determine the GPS coordinates ( , , ) of the target .
In figure 2.1 the user and target are at an altitude and , respectively, above the GPS reference ellipsoid surface ('sea level'). Since the Earth is a geoid and not a perfect sphere, the distance to the centre of the Earth from the 'sea level' is taken to be and respectively. The orientation of the user's camera is defined by the vector whose length is and whose zenith angle is . The angle subtended at the centre of mass of the Earth by and is denoted .
Figure 2.2 shows the projections of and onto the Celestial Sphere. The angle between the planes of the two great arcs and is the difference in the longitude, (= ), between and . The arc represents the co-latitude, , of the user; similarly represents . The arc represents (from figure 2.1). (= ) is the azimuth angle (measured due West of North) of the orientation vector (from figure 2.1).
![]() |
Figure 2.1: Plane of the triangle |
![]() |
Figure 2.2: Projections on the Celestial Sphere |
3 Computation of the target's coordinates
3.1 Analytical Expressions
The law of cosines on in figure 2.1 gives,
i.e.,
where , , , and are known ( is calculated from and the GPS reference ellipsoid (section 6)). This gives .
Similarly,
where , , , and are known. This gives and hence .
The cosine rule for spherical triangles on in figure 2.2 gives
i.e.,
where , , and are known. This gives and hence .
The sine rule for spherical triangles on in figure 2.2 gives
i.e.,
where , , and are known. This gives and hence .
3.2 Algorithm
- Acquire
, , and from location services (e.g. GPS). - Acquire
and from the geomagnetic field and gravity sensors, or equivalent sources. - Acquire
from the camera (if possible) or a range-finder accessory. - Compute
using and the GPS reference ellipsoid (section 6). - Compute
using equation ( ). - Compute
using equation ( ). Then compute . Note that and is non-negative. - Compute
using equation ( ). Then compute and . Note that and the sign of is determined by that of . - Compute
using equation ( ). Then compute . Note that is positive if , negative if , and if . - Compute
. - Compute
using and the GPS reference ellipsoid (section 6). - Compute
by subtracting from .
The coordinates of the target are thus determined to be ( , , ).
4 Initial order approximations
For the most common cases, where the user and the target are situated relatively close to each other (i.e. ), approximations can be employed for faster computational purposes.
The full set of initial order approximations is:
where , the distance to the centre of the Earth from 'sea level' at the user's location, must be first determined from and the GPS reference ellipsoid (section 6). The derivation of the above approximations can be done in two ways as follows.
4.1 The quick and dirty derivation
For very small angles and short distances (compared to the semi-major axis of the Earth), spherical triangles can be approximated by plane triangles, and arcs can be approximated by straight line segments. See corresponding figures 4.1 and 4.2. We use so that all unknown quantities are expressed in terms of known ones ( , , , , , , ).
The difference in elevation between the user and the target, , is approximated by the vertical component, , of the orientation vector. Thus,
which is equation ( ).
The 'horizontal distance' between the user and the target, , is approximated by the horizontal component, , of the orientation vector. Thus,
which is equation ( ).
The horizontal distance between the user and the target, , can itself be decomposed into two components. The component along the North-South axis is which approximates the difference in latitude measured as a distance at the longitude of the user, i.e. . Thus,
which is equation ( ).
Similarly, the component along the East-West axis is which approximates the difference in longitude measured as a distance at the latitude of the user, i.e. provided . Thus,
or
which is equation ( ).
4.2 The analytical derivation
We have and , , and so that we can neglect second order terms in , , and . Equation ( ) then becomes
or
The other equations yield , , and which are trivially correct and vacuous. These values are thus sensitive to second order terms.
Substituting and equation ( ) into equation ( ) gives
or
i.e.,
i.e.,
or
Thus
which is equation ( ).
Using in equation ( ),
and because (i.e. ),
or, provided ,
which is equation ( ).
Using , , and in equation ( )
which is equation ( ).
5 Dilution of precision and other sources of error
The use of a geomagnetic field sensor to determine the Azimuth angle has an inherent source of error because the magnetic field of the Earth is not precisely aligned to its polar-axis. However, this error can be corrected using the GPS reading, the global declination angle map, and the International Geomagnetic Reference Field model. This is already part of most navigation systems and implemented into smart phones. (See this, for instance.) Further work is required towards handling the errors inherent in the GPS coordinates of the user and is not covered here.
6. Determination of from and the GPS reference ellipsoid
The reference coordinate system used by GPS is defined by revision WGS 84 of the World Geodetic System standard. The coordinate origin is located at the Earth's centre of mass with the IERS Reference Meridian being the meridian of zero longitude. The surface is an oblate spheroid (ellipsoid) with a semi-major axis (equatorial radius) m and a semi-minor axis (polar radius) m so that the inverse flattening .
Any point on the reference ellipsoid at a latitude then satisfies the (polar form of the) equation of the corresponding generating ellipse: This gives the distance from the centre of the Earth for any point at latitude on the surface of the reference ellipsoid.