A radian is the ratio of an arc’s length to its radius. See the wiki diagram below Radians tend to be used in most trig formulas related to distance calculation, so we are definitely going to need a couple of functions to convert back and forwards to degrees, since mapping software is typically concerned with degrees of latitude and longtitude. Luckily the formula is very simple.

Page Content

#### VBA

```Public Function toRadians(deg)
toRadians = Application.WorksheetFunction.Pi / 180 * deg
End Function
End Function
```

```/**
* @param {number} deg degrees to convert
*/
return Math.PI() / 180 * deg;
}
/**
* @return {number} eqivalent degrees
*/
}
```

Another thing we are going to need to know is the earth’s radius, so lets create a function to return that consistently. The earth is not completely spherical, so I use the mean radius here – this is the value usually used for these kind of calculations.

#### VBA

```Public Function earthRadius() As Double
```function earthRadius() {