HAVERSIN

Purpose:

Computes the haversin of an expression.

Syntax:

HAVERSIN(val)

val

-

A scalar, series or array.

Returns:

A scalar, series or array.

Example:

W1: haversin(0..pi/100..2*pi)

 

Generates the haversin from 0 to 2π radians.

Example:

t = 0..0.01..1;

haversin(2*pi*3*t);

 

Create a 101 point series of a 3 Hz haversin sampled at 100 samples per second.

Remarks:

The haversin function is defined as:

 

 

The function was historically used in navigation to calculate great-circle distances between two points on a sphere (like Earth) given their longitudes and latitudes.

 

See GHAVERSIN  to generate a haversin with a specified length and delta x.

See Also:

GHALFSIN

GHAVERSIN

GSIN

SIN

References:

[1]

C. C. Robusto

 

The Cosine-Haversine Formula

 

The American Mathematical Monthly, 64(1), 1957

 

pp 38-40