gives the inverse haversine function
.
InverseHaversine
gives the inverse haversine function
.
Details
- Mathematical function, suitable for both symbolic and numerical manipulation.
- The inverse haversine function is defined by
. - All results are given in radians.
- For real
between
and
, the results are always in the range
to
. - InverseHaversine[z] has branch cut discontinuities in the complex
plane running from
to
and
to
. - InverseHaversine can be evaluated to arbitrary numerical precision.
- InverseHaversine automatically threads over lists. »
- InverseHaversine can be used with Interval and CenteredInterval objects. »
Examples
open all close allBasic Examples (5)
InverseHaversine[.5]Plot over a subset of the reals:
Plot[InverseHaversine[x], {x, 0, 1}]Plot over a subset of the complexes:
ComplexPlot3D[InverseHaversine[z], {z, -1 / 3 - I, 1 / 3 + I}, PlotLegends -> Automatic]Series expansion at the origin:
Series[InverseHaversine[x], {x, 0, 5}]Asymptotic expansion at a singular point:
Series[InverseHaversine[x], {x, 1, 3}, Assumptions -> x < 1] // FullSimplifyScope (30)
Numerical Evaluation (6)
InverseHaversine[.8]N[InverseHaversine[1 / 7], 50]The precision of the output tracks the precision of the input:
InverseHaversine[0.2000000000000000000]N[InverseHaversine[798 + I]]Evaluate efficiently at high precision:
InverseHaversine[15`100]//TimingInverseHaversine[8`100000];//TimingCompute the elementwise values of an array using automatic threading:
InverseHaversine[ {{1 / 2, 0}, {1 / 4, 1 / 2}}]Or compute the matrix InverseHaversine function using MatrixFunction:
MatrixFunction[InverseHaversine[#]&, {{1 / 2, 0}, {1 / 4, 1 / 2}}]Compute worst-case guaranteed intervals using Interval and CenteredInterval objects:
InverseHaversine[Interval[{0.5, 0.6}]]InverseHaversine[CenteredInterval[2 / 3, 1 / 100]]Or compute average-case statistical intervals using Around:
InverseHaversine[Around[1 / 2, 0.01]]Specific Values (3)
Values of InverseHaversine at fixed points:
Table[InverseHaversine[1 / n], {n, 1, 4}]The value of InverseHaversine at zero:
InverseHaversine[0]Find a value of
for which
using Solve:
xzero = x /. Solve[InverseHaversine[x] == 2, x][[1]]Plot[InverseHaversine[x], {x, 0, 1}, Epilog -> Style[Point[{xzero, InverseHaversine[xzero]}], PointSize[Large], Red]]Visualization (2)
Plot the InverseHaversine function:
Plot[InverseHaversine[x], {x, 0, 1}]Plot the real part of InverseHaversine[z]:
ComplexContourPlot[Re[InverseHaversine[z]], {z, -1 - I, 2 + I}, IconizedObject[«PlotOptions»]]Plot the imaginary part of InverseHaversine[z]:
ComplexContourPlot[Im[InverseHaversine[z]], {z, -1 - 2I, 2 + 2I}, IconizedObject[«PlotOptions»]]Function Properties (10)
InverseHaversine is defined for all real values from the interval [0,1]:
FunctionDomain[InverseHaversine[x], x]InverseHaversine is defined for all complex values:
FunctionDomain[InverseHaversine[z], z, Complexes]FunctionRange[InverseHaversine[x], x, y]InverseHaversine is not an analytic function:
FunctionAnalytic[InverseHaversine[x], x]FunctionMeromorphic[InverseHaversine[x], x]InverseHaversine is non-decreasing over its real domain:
FunctionMonotonicity[{InverseHaversine[x], 0 ≤ x ≤ 1}, x]InverseHaversine is injective:
FunctionInjective[InverseHaversine[x], x]Plot[{InverseHaversine[x], 2}, {x, 0, 1}]InverseHaversine is not surjective:
FunctionSurjective[InverseHaversine[x], x]Plot[{InverseHaversine[x], -1}, {x, 0, 1}]InverseHaversine is non-negative over its real domain:
FunctionSign[{InverseHaversine[x], 0 ≤ x ≤ 1}, x]InverseHaversine does have both singularity and discontinuity in (-∞,0] and [1,∞):
FunctionSingularities[InverseHaversine[x], x]FunctionDiscontinuities[InverseHaversine[x], x]InverseHaversine is neither convex nor concave:
FunctionConvexity[InverseHaversine[x], x]TraditionalForm formatting:
InverseHaversine[x]//TraditionalFormDifferentiation (3)
D[InverseHaversine[z], z]Table[D[InverseHaversine[z], {z, k}], {k, 1, 4}]//FullSimplifyPlot[%, {z, 0, 1}, PlotLegends -> {"First Derivative", "Second Derivative", "Third Derivative", "Fourth Derivative"}]The formula for the ![]()
derivative:
D[InverseHaversine[z], {z, k}]// FullSimplifyIntegration (3)
Compute the indefinite integral using Integrate:
Integrate[InverseHaversine[x], x]// FullSimplifyIntegrate[InverseHaversine[x], {x, -1 / 2, 1 / 2}]Integrate[x^2InverseHaversine[x] , x]// FullSimplifyIntegrate[Log10[x] InverseHaversine [x], {x, 0, 1 / 2}]// FullSimplifySeries Expansions (3)
Find the Taylor expansion using Series:
Series[InverseHaversine[x], {x, 0, 5}]Plots of the first three approximations around
:
terms = Normal@Table[Series[InverseHaversine[x], {x, 0, m}], {m, 1, 5, 2}];
Plot[{InverseHaversine[x], terms}, {x, 0, 5}, PlotRange -> {{0, 2}, {0, 4}}]The Taylor expansion at a generic point:
Series[InverseHaversine[x], {x, x0, 2}]// FullSimplifyInverseHaversine can be applied to a power series:
InverseHaversine[x + O[x] ^ 4]Applications (2)
Distance between two points on a sphere:
SphereDistance[{ϕ1_, θ1_}, {ϕ2_, θ2_}, r_] := r InverseHaversine[Haversine[ϕ1 - ϕ2] + Cos[ϕ1]Cos[ϕ2]Haversine[θ1 - θ2]]Distance between two cities in kilometers:
SphereDistance[c1_, c2_] := Module[{k1, k2, res}, {k1, k2} = CityData[#, "Coordinates"]& /@ {c1, c2};res = SphereDistance[k1 Degree, k2 Degree, 6378.14];res /; NumberQ[res]]SphereDistance["New York", "Los Angeles"]Find the distance between the North Pole and the nearest city to it, using the defined function with InverseHaversine and Haversine:
Min[{SphereDistance[#, "North Pole"]& /@ {"Stockholm", "Moscow", "Helsinki"}}]Modeling Lévy's second arc sine law:
With[{n = 1000}, ListPlot[MapIndexed[{#1, #2[[1]] / n}&, Sort[Table[Position[FoldList[Plus, 0, RandomChoice[{-1, 1}, n]], 0][[-1, 1]] / n, {n}]]]]]Show[%, Plot[InverseHaversine[x] / Pi, {x, 0, 1}, PlotStyle -> {Thick, Orange, Dashed}]]Properties & Relations (2)
Derivative of inverse haversine function:
D[InverseHaversine[x], x]Integral of inverse haversine function:
Integrate[InverseHaversine[x], x]Use FunctionExpand to expand InverseHaversine:
InverseHaversine[x]//FunctionExpandRelated Guides
Related Links
History
Text
Wolfram Research (2008), InverseHaversine, Wolfram Language function, https://reference.wolfram.com/language/ref/InverseHaversine.html.
CMS
Wolfram Language. 2008. "InverseHaversine." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/InverseHaversine.html.
APA
Wolfram Language. (2008). InverseHaversine. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/InverseHaversine.html
BibTeX
@misc{reference.wolfram_2026_inversehaversine, author="Wolfram Research", title="{InverseHaversine}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/InverseHaversine.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_inversehaversine, organization={Wolfram Research}, title={InverseHaversine}, year={2008}, url={https://reference.wolfram.com/language/ref/InverseHaversine.html}, note=[Accessed: 13-June-2026]}