Drawing geodesic curves using the Bing maps Silverlight control

Wednesday, June 30th, 2010

For an upcoming post I wanted to be able to plot the shortest routes between various positions on the Earth using the Bing Maps Silverlight control. Although since I started working on the problem Bing have provided a similar feature with their Distance Calculator App, the functions are not available for reuse via the public API. Interested developers may just want to skip the maths and just download the code.

Geodesic source code for Silverlight 4.0

Geodesics

Geodesic

The shortest path between two points on an arbitrary surface is called a Geodesic, and on a sphere, it is a Great Circle. Modelling the surface of the earth as a perfect sphere, the shortest distance between any two locations on the surface is then described by a section of a Great Circle, ie an arc that lies on the plane that is described by the vectors between its start and end points and the Earth’s centre ( see figure 1 ).

With this information, one way ( and the way I have adopted ) to plot such a curve is as follows:

  1. Generate the points of the curve in two dimensions using the parametric equation of a circle.
  2. Transform the plane of the 2d curve into 3D space such that it intersects the end points on the sphere, and the sphere’s centre.
  3. Project the transformed points back into 2D space using the Mercator projection equations.

(more…)

Winter Camping

Thursday, January 21st, 2010
Figured out the self timer

Last week myself and a group of friends took a winter camping trip up to the Lake District. An odd decision, it could be argued, seen as the region has recently seen both some of its worst flooding and coldest winters in recent years.  Nonethless, equipped with ice axe, crampons and a generous supply of Kendal Mint Cake we set out to climb Scafell.

(more…)