# Hansen's problem

**Hansen's problem** is a problem in planar surveying, named after the astronomer Peter Andreas Hansen (1795–1874), who worked on the geodetic survey of Denmark. There are two known points *A* and *B*, and two unknown points *P*_{1} and *P*_{2}. From *P*_{1} and *P*_{2} an observer measures the angles made by the lines of sight to each of the other three points. The problem is to find the positions of *P*_{1} and *P*_{2}. See figure; the angles measured are (*α*_{1}, *β*_{1}, *α*_{2}, *β*_{2}).

Since it involves observations of angles made at unknown points, the problem is an example of resection (as opposed to intersection).

## Solution method overview

Define the following angles:
*γ* = *P*_{1}*AP*_{2}, *δ* = *P*_{1}*BP*_{2}, *φ* = *P*_{2}*AB*, *ψ* = *P*_{1}*BA*.
As a first step we will solve for *φ* and *ψ*.
The sum of these two unknown angles is equal to the sum of *β*_{1} and *β*_{2}, yielding the equation

A second equation can be found more laboriously, as follows. The law of sines yields

- and

Combining these, we get

Entirely analogous reasoning on the other side yields

Setting these two equal gives

Using a known trigonometric identity this ratio of sines can be expressed as the tangent of an angle difference:

Where

This is the second equation we need. Once we solve the two equations for the two unknowns and , we can use either of the two expressions above for to find *P*_{1}*P*_{2} since *AB* is known. We can then find all the other segments using the law of sines.

## Solution algorithm

We are given four angles (*α*_{1}, *β*_{1}, *α*_{2}, *β*_{2}) and the distance *AB*. The calculation proceeds as follows:

- Calculate
- Calculate
- Let and then
- Calculate or equivalentlyIf one of these fractions has a denominator close to zero, use the other one.