Haversine

Author

Eric W. Weisstein
September 14, 2008

This notebook downloaded from http://mathworld.wolfram.com/notebooks/SpecialFunctions/Haversine.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/Haversine.html.

©2008 Wolfram Research, Inc. except for portions noted otherwise

Notation

Haversine[z]//TraditionalForm

Definition

Haversine[z]//FunctionExpand//TraditionalForm

FullSimplify[Haversine[z]//FunctionExpand]//TraditionalForm

Derivative and Integral

Derivative

D[Haversine[z],z]//TraditionalForm

Integral

Integrate[Haversine[z],z]//Simplify//TraditionalForm

Inverse

Haversine[InverseHaversine[z]]

Haversine[InverseHaversine[z]]//FullSimplify

InverseHaversine[Haversine[z]]//FullSimplify

Series

Series[Haversine[z],{z,0,10}]

Denominator[CoefficientList[Series[Haversine[z],{z,0,20}],z^2]]

RSolve[{(-4n^2-6n-2)a[n]+a[n+1]==0,a[0]==1},a[n],n]

Table[2 (4^n) Pochhammer[(1/2),n] Pochhammer[1,n],{n,10}]

FullSimplify[2 (4^n) Pochhammer[(1/2),n] Pochhammer[1,n]]

Table[2Factorial[2n],{n,10}]

Sum[((((-1))^(k-1))/(2(2k)!))(x^(2k)),{k,5}]

Sum[((((-1))^(k-1))/(2(2k)!))(x^(2k)),{k,∞}]

FullSimplify[%]

SeriesCoefficient[Haversine[z],{z,0,n}]

ser=SeriesCoefficient[Haversine[z]//FunctionExpand,{z,0,n}]

FullSimplify[ser]

Simplify[-(((((-I))^n)+(I^n)-2 n!)/(4 n!)),n==0]

Generating Function

Sum[-(((((-I))^n)+(I^n))/(4 n!))(x^n),{n,∞}]

FullSimplify[%]

GeneratingFunction[If[n==0,0,-(((((-I))^n)+(I^n))/(4 n!))],n,x]

FullSimplify[%]

Sum[-((Cos[((n π)/2)])/(2 n!))(x^n),{n,∞}]

GeneratingFunction[If[n==0,0,-((Cos[((n π)/2)])/(2 n!))],n,x]

Plots

Plot[Haversine[x],{x,-2π,2π},PlotStyle->Red,Ticks->
{(Range[-2,2,1/2]π),Range[0,2,1/2]},
PlotLabel->HoldForm[Haversine[x]]]

ComplexPlot3D[Haversine[z],{z,-5,5},ComplexPlotLabel->HoldForm[Haversine[z]]]//Timing

ComplexContourPlot[Haversine[z],{z,-5,5},ComplexPlotLabel->HoldForm[Haversine[z]]]//Timing