2015-06-05

Geometric Identification of Points-of-Interest: Theory and Equations

Roshan Kamath, Vidyadhar Gurram
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
λu User's longitude (0λu<2π)
δu User's latitude (π/2<δu<π/2)
hu User's height above sea level
Ru Distance to the centre of the Earth from sea level at the user's position
A Azimuth angle of the camera orientation measured due West  of North and valid only when δu±π/2 (0A<2π)
z Zenith angle of the camera orientation (0zπ)
r Euclidean straight line distance from the camera to the target  along the camera orientation vector
λt Target's longitude (0λt<2π)
δt Target's latitude (π/2<δt<π/2)
ht Target's height above sea level
Rt 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 (0απ)
Δλ λtλu, the difference between the target and user longitudes
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 (λu,δu,hu) of the user U, the orientation (A,z) of the user's camera, and the distance r to the target T being photographed, determine the GPS coordinates (λt,δt,ht) of the target T.
Figure 2.1: Plane of the triangle UTC
Figure 2.1: Plane of the triangle UTC
In figure 2.1 the user U and target T are at an altitude hu and ht, 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 Ru and Rt respectively. The orientation of the user's camera is defined by the vector UT whose length is r and whose zenith angle is z. The angle subtended at the centre of mass of the Earth by U and T is denoted α.
Figure 2.2: Projections on the Celestial Sphere
Figure 2.2: Projections on the Celestial Sphere
Figure 2.2 shows the projections of U and T onto the Celestial Sphere. The angle between the planes of the two great arcs NU^ and NT^ is the difference in the longitude, Δλ (= λtλu), between U and T. The arc NU^ represents the co-latitude, π2δu, of the user; similarly NT^ represents π2δt. The arc UT^ represents α (from figure 2.1). NUT (= A) is the azimuth angle (measured due West of North) of the orientation vector UT (from figure 2.1).

3 Computation of the target's coordinates

3.1 Analytical Expressions

The law of cosines on ΔCUT in figure 2.1 gives,
(Rt+ht)2=r2+(Ru+hu)22r(Ru+hu)cos(πz)
i.e.,
(Rt+ht)2= r2+(Ru+hu)2(1)+2r(Ru+hu)cos(z)
where r, Ru, hu, and z are known (Ru is calculated from δu and the GPS reference ellipsoid (section 6)). This gives (Rt+ht).

Similarly,
r2= (Ru+hu)2+(Rt+ht)2(2)2(Ru+hu)(Rt+ht)cos(α)
where r, Ru, hu, and (Rt+ht) are known. This gives cos(α) and hence α.

The cosine rule for spherical triangles on ΔNUT in figure 2.2 gives
cos(π2δt)=cos(π2δu)cos(α)+sin(π2δu)sin(α)cos(A)
i.e.,
(3)sin(δt)=sin(δu)cos(α)+cos(δu)sin(α)cos(A)
where δu, α, and A are known. This gives sin(δt) and hence δt.

The sine rule for spherical triangles on ΔNUT in figure 2.2 gives
sin(Δλ)sin(α)=sin(A)sin(π2δt)provided δt±π/2
i.e.,
(4)sin(Δλ)=sin(α)sin(A)cos(δt)for δt±π/2
where α, A, and δt are known. This gives Δλ and hence λt (=λu+Δλ).

3.2 Algorithm

  1. Acquire λu, δu, and hu from location services (e.g. GPS).
  2. Acquire A and z from the geomagnetic field and gravity sensors, or equivalent sources.
  3. Acquire r from the camera (if possible) or a range-finder accessory.
  4. Compute Ru using δu and the GPS reference ellipsoid (section 6).
  5. Compute Rt+ht using equation (1).
  6. Compute cos(α) using equation (2). Then compute sin(α). Note that 0απ and sin(α) is non-negative. 
  7. Compute sin(δt) using equation (3). Then compute cos(δt) and δt. Note that π/2<δt<π/2 and the sign of δt is determined by that of sin(δt).
  8. Compute sin(Δλ) using equation (4). Then compute Δλ. Note that Δλ is positive if 0<A<π, negative if π<A<2π, and 0 if A=0 or π.
  9. Compute λt=λu+Δλ.
  10. Compute Rt using δt and the GPS reference ellipsoid (section 6).
  11. Compute ht by subtracting Rt from (Rt+ht).
The coordinates of the target are thus determined to be (λt, δt, ht).

4 Initial order approximations

For the most common cases, where the user and the target are situated relatively close to each other (i.e. |α|1), approximations can be employed for faster computational purposes.

The full set of initial order approximations is:
(5)hthu+rcosz(6)αrsinz(Ru+hu)(7)δtδu+αcosA(8)λtλu+αsinAcosδufor δu±π/2
where Ru, the distance to the centre of the Earth from 'sea level' at the user's location, must be first determined from δu 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 RtRu so that all unknown quantities are expressed in terms of known ones (λu, δu, hu, A, z, r, Ru).
Figure 4.1: Plane of the triangle TC for very small alpha
Figure 4.1: Plane of the triangle UTC for very small α

Figure 4.2: Projections on the Celestial Sphere for very small alpha
Figure 4.2: Projections on the Celestial Sphere for very small α
The orientation vector of length r can be decomposed into two components. The vertical component is rcosz while the horizontal component is rsinz.

The difference in elevation between the user and the target, hthu, is approximated by the vertical component, rcosz, of the orientation vector. Thus,
hthu+rcosz
which is equation (5).

The 'horizontal distance' between the user and the target, α(Ru+hu), is approximated by the horizontal component, rsinz, of the orientation vector. Thus,
αrsinz(Ru+hu)
which is equation (6).

The horizontal distance between the user and the target, α(Ru+hu), can itself be decomposed into two components. The component along the North-South axis is α(Ru+hu)cosA which approximates the difference in latitude measured as a distance at the longitude of the user, i.e. (Ru+hu)(δtδu). Thus,
δtδu+αcosA
which is equation (7).

Similarly, the component along the East-West axis is α(Ru+hu)sinA which approximates the difference in longitude measured as a distance at the latitude of the user, i.e. Δλ(Ru+hu)cosδu provided δu±π/2. Thus,
ΔλαsinAcosδufor δu±π/2
or
λtλu+αsinAcosδufor δu±π/2
which is equation (8).

4.2 The analytical derivation

We have RtRu and huRu, htRu, and rRu so that we can neglect second order terms in huRu, htRu, and rRu. Equation (1) then becomes
(Ru+ht)2r2+(Ru+hu)2+2r(Ru+hu)cos(z)Ru2(1+htRu)2r2+Ru2(1+huRu)2+2r(Ru+hu)cos(z)(1+htRu)2(1+huRu)2+2rcos(z)Ru(1+2htRu)(1+2huRu)+2rcoszRu
or
hthu+rcoszwhich is equation (5).

The other equations yield α0, δtδu, and Δλ0 which are trivially correct and vacuous. These values are thus sensitive to second order terms.

Substituting RtRu and equation (5) into equation (2) gives
r2 (Ru+hu)2+(Ru+hu+rcosz)22(Ru+hu)(Ru+hu+rcosz)cosα= 2(Ru+hu)2+2(Ru+hu)(rcosz)+(rcosz)22(Ru+hu)2cosα2(Ru+hu)(rcosz)cosα= 2(Ru+hu)2(1cosα)+2(Ru+hu)(rcosz)(1cosα)+(rcosz)2
or
(rsinz)22(Ru+hu)(1cosα)(Ru+hu+rcosz)=2(Ru+hu)(Ru+hu+rcosz)(2sin2(α2))
i.e.,
sin2(α2)(rsinz)24(Ru+hu)(Ru+hu+rcosz)=(rsinz)24(Ru+hu)2(1+rcoszRu+hu)(rsinz)24(Ru+hu)2(1rcoszRu+hu)(rsinz)24(Ru+hu)2
i.e.,
sin(α2)rsinz2(Ru+hu)
or
α2rsinz2(Ru+hu)as |α|1
Thus
αrsinz(Ru+hu)
which is equation (6).

Using |α|1 in equation (3),
sinδtsinδu+(cosδu)(α)cosAsinδtsinδuαcosδucosA2sin(δtδu2)cos(δt+δu2)αcosδucosA
and because δtδu (i.e. |δtδu|1),
2(δtδu2)cos2δu2αcosδucosA(δtδu)cosδuαcosδucosA
or, provided δu±π/2,
δtδu+αcosA
which is equation (7).

Using |Δλ|1, |α|1, and δtδu in equation (4)
ΔλαsinAcosδufor δu±π/2i.e.,λtλu+αsinAcosδufor δu±π/2
which is equation (8).

5 Dilution of precision and other sources of error

The use of a geomagnetic field sensor to determine the Azimuth angle A 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 R 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) a=6378137.0m and a semi-minor axis (polar radius) b=6356752.314245m so that the inverse flattening 1/f=298.257223563.

Any point on the reference ellipsoid at a latitude δ then satisfies the (polar form of the) equation of the corresponding generating ellipse:R(δ)=(ab)/(asinδ)2+(bcosδ)2This gives the distance R(δ) from the centre of the Earth for any point at latitude δ on the surface of the reference ellipsoid.