Goal
Calculate the shortest spherical-surface distance and central angle between two latitude-longitude points on a sphere.
Worldwide context
Saved once here, used across the site.
Currency changes display only. Country selection guides tax input; no tax rate is guessed.
Calculate the shortest spherical-surface distance and central angle between two latitude-longitude points on a sphere.
a = sin^2((phi2 - phi1)/2) + cos(phi1) cos(phi2) sin^2((lambda2 - lambda1)/2); central angle = 2 atan2(sqrt(a), sqrt(1-a)); distance = R central angle.A clearer path to an answer
This page keeps the calculation transparent: define the goal, enter the matching values, inspect the method, and decide what the result means in your situation.
Calculate the shortest spherical-surface distance and central angle between two latitude-longitude points on a sphere.
Sphere radius · Point 1 latitude · Point 1 longitude · Point 2 latitude · Point 2 longitude
a = sin^2((phi2 - phi1)/2) + cos(phi1) cos(phi2) sin^2((lambda2 - lambda1)/2); central angle = 2 atan2(sqrt(a), sqrt(1-a)); distance = R central angle.
Calculate, review the assumptions below, then compare a related tool when the decision needs more context.
Calculate the shortest spherical-surface distance and central angle between two latitude-longitude points on a sphere.
Open the Great-Circle Distance pageMore math tools
Download PDFDownload Word (.doc)
Enter your values above and choose Calculate to see the result here.
Calculation map
a = sin^2((phi2 - phi1)/2) + cos(phi1) cos(phi2) sin^2((lambda2 - lambda1)/2); central angle = 2 atan2(sqrt(a), sqrt(1-a)); distance = R central angle.
Bounded, transparent calculation
Your recent runs stay in this browser session only.
Formula: a = sin^2((phi2 - phi1)/2) + cos(phi1) cos(phi2) sin^2((lambda2 - lambda1)/2); central angle = 2 atan2(sqrt(a), sqrt(1-a)); distance = R central angle.
Convert latitude and longitude differences from degrees to radians, evaluate the haversine central angle, and multiply that angle by the sphere radius to obtain the shorter great-circle arc distance.
Worked example: The central angle is pi/2 radians and the quarter-sphere distance is 6371 x pi/2 = about 10007.543 distance units.
The displayed limits are checked before the handler runs. Model-specific domain checks may also reject impossible or non-finite inputs.
Methodology: This calculator follows the WorldCalculate input, formula, precision, and boundary policy. Read the official methodology.
Calculator usage statistics
This section counts anonymous successful Calculate submissions, not unique visitors. Counts and top tools appear only when trusted aggregate data is available; country analysis is shown only under the same condition and reporting threshold.
Answer-first guide
Calculate the shortest spherical-surface distance and central angle between two latitude-longitude points on a sphere. Start with one clearly defined goal, enter values in the units shown, and keep the result attached to the assumptions below.
This tool is useful when your question includes great-circle distance, spherical distance, haversine formula. It returns the outputs declared in the calculator contract rather than a live quote, approval, diagnosis, or professional sign-off.
Sphere radius · Point 1 latitude · Point 1 longitude · Point 2 latitude · Point 2 longitude. Keep the same time period, unit system, and currency wherever the form requires comparable values.
Run the worked example first, compare its output with the page's example, then change one input at a time. This makes an unexpected result easier to trace to a unit, boundary, or assumption.
Need a wider view? Browse Math Calculators or compare the related tools below. The WorldCalculate methodology explains how formulas, examples, limits, and revisions are reviewed.
a = sin^2((phi2 - phi1)/2) + cos(phi1) cos(phi2) sin^2((lambda2 - lambda1)/2); central angle = 2 atan2(sqrt(a), sqrt(1-a)); distance = R central angle.
Convert latitude and longitude differences from degrees to radians, evaluate the haversine central angle, and multiply that angle by the sphere radius to obtain the shorter great-circle arc distance.
The central angle is pi/2 radians and the quarter-sphere distance is 6371 x pi/2 = about 10007.543 distance units.
Context and background
Math calculators move from named quantities to a relation, then to a result that can be checked with substitution, units, or an alternate form.
Arithmetic, algebra, geometry, trigonometry, and number theory provide reusable structures for classroom work and everyday reasoning. Each page narrows that structure to one declared problem.
Research and review
Researched by Hassan ALRowaie, Founder and editorial researcher at WorldCalculate.
This guide follows the live calculator's declared inputs, formula, worked example, assumptions, validation boundaries, and source-backed methodology. The review date describes editorial review of the calculator explanation; it is not a promise that external facts or rates remain current.
Great-circle distance is the length of the shorter arc on a spherical surface between two angular positions. This calculator accepts a positive sphere radius, two latitudes, and two longitudes, with all angles entered in degrees. It converts the angles to radians, uses the haversine form to obtain a central angle, and multiplies that angle by the radius. The first result is the surface distance in the radius unit, and the second is the central angle in radians. The model is an ideal sphere. It does not flatten an ellipsoid, include altitude or terrain, follow roads, or estimate travel time. The guide explains angular coordinates, the haversine derivation, examples, endpoints, numerical safeguards, longitude conventions, comparisons, and the limits of applying a spherical arc to real-world routes.
A great circle is formed where a plane through the center of a sphere intersects the spherical surface. Its radius is the sphere radius, and its circumference is the largest circle available on that sphere. The shortest surface path between two non-antipodal points follows the shorter arc of a great circle. The calculator reports that arc length by first finding the angle at the sphere center. That central angle is dimensionless in radians, while multiplying it by the sphere radius restores a distance unit.
This is a surface-distance model, not a straight chord through the sphere. A chord cuts through the interior and is shorter than the corresponding nonzero arc. A road route, hiking route, flight plan, or ocean path may also differ because it follows constraints and may use an ellipsoidal or local model. The page answers the ideal spherical question when angular positions and a radius are enough for the intended comparison.
Enter latitude1 and longitude1 for the first point, then latitude2 and longitude2 for the second. Latitude ranges from -90 degrees at one pole through 0 at the equator to 90 degrees at the other pole. Longitude is represented here from -180 through 180 degrees. The radius sets the scale of the sphere and must be positive. The two points are angular coordinates; they are not Cartesian x and y values and should not be entered into the coordinate-distance page without a conversion.
The radius unit determines the distance unit. A radius of 6,371 kilometres produces a distance in kilometres; the same numerical radius could be interpreted in miles only if the input unit is miles. The page does not identify a planet, datum, altitude, or coordinate reference system. It accepts the declared angular values and ideal radius as a mathematical contract. Values outside the latitude or longitude limits, nonfinite values, and numeric strings passed to the direct handler are rejected.
Let phi1 and phi2 be the latitudes in radians, and let lambda1 and lambda2 be the longitudes in radians. The haversine term is a = sin^2((phi2 - phi1)/2) + cos(phi1) cos(phi2) sin^2((lambda2 - lambda1)/2). The central angle is c = 2 atan2(sqrt(a), sqrt(1 - a)). The distance is R c. This arrangement remains well behaved for small angular separations because it avoids relying only on a subtraction of nearly equal cosine values.
The input is in degrees, so every latitude and longitude used by a trigonometric function is multiplied by pi/180 first. The longitude difference may be as large as 360 degrees when one endpoint is represented at -180 and the other at 180; those endpoints describe the same meridian and the sine-squared term handles the equivalent angular position. The engine checks the computed haversine term and clamps only tiny floating-point boundary drift into the mathematical interval from zero to one.
Use radius 6371 distance units, point 1 at latitude 0 and longitude 0, and point 2 at latitude 0 and longitude 90. Both points lie on the equator, separated by a quarter turn. The latitude difference is zero, and the longitude difference is pi/2 radians. The haversine term is sin^2(pi/4) = 1/2. The central angle becomes pi/2 radians, and the distance is 6371 x pi/2, approximately 10007.543 distance units.
The example can be checked by circumference reasoning. A full equatorial circle has length 2 pi R, so one quarter of it has length pi R/2. The haversine result agrees with that geometric construction. If the radius is doubled while the two angular points remain fixed, the central angle stays pi/2 and the distance doubles. If the radius remains fixed but the longitude separation is reduced, the distance decreases on this equatorial example.
If the two angular positions are the same, the haversine term is zero, the central angle is zero, and the distance is zero. This is a valid result because no division by the distance occurs. At opposite points on the sphere, the central angle is pi radians and the shorter arc is a semicircle with distance pi R. The engine includes the latitude and longitude endpoints needed to represent pole and antipodal cases and checks that their finite outputs remain renderer-safe.
Longitude is not unique at a pole because every meridian meets there. The formula still produces the same angular separation when the latitude is exactly 90 or -90, subject to the entered endpoint representation. At antipodes, there are infinitely many equally short great-circle routes, all with the same length. The calculator returns the length and angle only; it does not choose a particular bearing or route among those geometric possibilities.
This contract accepts longitudes from -180 to 180 degrees, inclusive. The same meridian can be written with different equivalent values in other conventions, such as 0 through 360 degrees, but those values must be normalized before entry. A pair near the branch boundary should be interpreted as angular positions on the sphere, not as a demand to travel through the larger longitude difference. The haversine sine-squared structure naturally identifies the shorter spherical separation.
The result is always the shorter central angle produced by the atan2 expression, from zero through pi. It does not return a signed eastward or westward direction. If direction, bearing, crossing a chosen dateline, or a long arc is required, additional fields and a different output contract are needed. Keeping branch and direction choices out of this page prevents a single distance number from being read as a complete navigation instruction.
Many physical bodies are not perfect spheres. An oblate body has a radius that changes with latitude, and a geodetic calculation may require an ellipsoid's semi-major axis, flattening, height, and datum. This calculator deliberately compresses scale into one sphere radius. That makes the formula transparent and useful for classroom geometry, rough scale checks, and applications where spherical approximation is accepted. It should not be described as a universal high-precision surface distance.
Altitude is also excluded. If two points have different heights above a reference surface, the ideal spherical arc between their angular positions does not contain that vertical information. A straight three-dimensional separation would require Cartesian positions or another explicit model. Likewise, a travel route needs roads, barriers, traffic, or vehicle constraints. Choose the calculator by the intended geometry rather than by the familiarity of the word distance.
The radius is bounded from 0.000001 through 1,000,000,000 distance units. Latitudes and longitudes use their closed angular ranges. These limits protect the browser contract and keep the result finite; they are not claims about planetary size or valid scientific data. The pure handler validates every field independently before converting angles. Missing values, numeric strings, NaN, infinities, and out-of-range values generate errors rather than becoming zero or being wrapped into another longitude.
The haversine term is mathematically between zero and one, but floating-point arithmetic can produce a tiny value just outside an endpoint. The handler rejects a materially invalid term and clamps only the allowed round-off drift before taking square roots. It then checks both central angle and radius-times-angle distance. Results identify distance units and radians explicitly. The displayed precision is a presentation decision and should not be mistaken for the accuracy of the radius or coordinates.
A great-circle distance follows a surface arc, while a chord is the straight segment through the sphere's interior. For the same central angle and radius, the arc is at least as long as the chord. A 3D Euclidean distance between Cartesian surface points is the chord length, not the great-circle result. A Manhattan distance would further impose axis-aligned movement in a chosen coordinate frame and has no direct reason to agree with either spherical quantity.
The central angle itself is a useful angular output independent of the radius. Two bodies with the same angular separation have the same central angle but different arc lengths when their radii differ. Conversely, two pairs with different angular separations can have the same distance if their radii differ. Keep the radius, angle, and surface assumption together when comparing results. A bare number called distance is not enough to identify the metric.
The calculator is useful for spherical-trigonometry exercises, ideal globe measurements, astronomy scale examples, and software tests of a haversine implementation. For a review, preserve radius, both angular pairs, the degree convention, the central angle in radians, and the distance unit. Check a coincident pair, a quarter-turn equatorial pair, and an antipodal pair when endpoint behavior matters. These cases expose degree conversion, radius scaling, and branch mistakes quickly.
Do not use the output alone to dispatch a vehicle, certify a survey, estimate fuel, or promise travel time. Validate the reference surface, coordinate quality, datum, altitude, route, and uncertainty in the domain system that owns the decision. The page performs local deterministic arithmetic and does not send coordinate values to a service. Keep sensitive locations out of shared records when an angular pair could disclose a private place.
A useful boundary test places one point at longitude 179 degrees and the other at longitude -179 degrees with equal latitude. Their numeric longitude values differ by -358 degrees, but the sine-squared half-difference describes the short two-degree separation around the meridian boundary. This is a consequence of spherical angular periodicity, not a license to interpret every signed difference as a travel direction. The calculator reports the shorter central angle and leaves direction to another model.
The endpoints -180 and 180 represent the same meridian. If both points have the same latitude and those endpoint longitudes, the distance is zero. A large result in that case usually indicates that a downstream implementation used a raw longitude difference without the trigonometric periodic behavior. Test the boundary with a known radius and retain the entered convention when documenting the result.
The central angle comes entirely from the two angular positions. The radius then scales that angle into a length. This separation makes the calculator useful for comparing the same angular pair on different ideal spheres, but it also makes radius selection the main approximation decision. A mean radius, local radius, or another conventional value can produce different distances. Record the chosen radius and its unit rather than presenting the output as independent of that choice.
For a small central angle c, the arc distance R c is approximately a local flat-surface distance when the sphere model is accepted. As the angle grows, curvature becomes an essential part of the result. The calculator does not switch formulas based on distance or blend a local projection into the spherical arc. If an application needs local map accuracy or an ellipsoidal geodesic, select that method deliberately and compare its inputs and outputs with this simpler spherical contract.
A complete record preserves radius, both latitude-longitude pairs, the degree convention, the haversine term, central angle in radians, and the distance unit. Recompute a quarter-equator example and an antipodal example to verify the implementation. At equal positions, expect zero. At equal latitude on the equator, compare with the appropriate fraction of the circumference. These checks separate angle conversion and radius scaling from questions about a real map or route.
When this value is handed to a navigation, geographic, or scientific workflow, state whether it is an ideal spherical arc or an input to a more detailed model. Do not discard the coordinate datum, altitude, or uncertainty metadata from the source. The page deliberately calculates locally from five numbers and does not query a map service. Its result can support a transparent estimate, but the surrounding application remains responsible for the choice of surface and the consequences of using the distance.
A change in latitude is an angular movement along a meridian, while a change in longitude traces a parallel whose physical circumference depends on latitude. The haversine formula combines both effects on the sphere rather than multiplying raw degree differences by one constant. Near a pole, longitude lines converge, so a fixed longitude difference contributes less surface separation than it would at the equator. This is one reason a simple independent degree-to-distance conversion can be misleading.
The calculator uses the complete pair of positions and the sphere radius, so it handles latitude and longitude together. It does not return the separate north-south and east-west components. If those components or a bearing are needed, use a coordinate-difference method designed for that output and state its local approximation. A total great-circle distance cannot by itself reveal how much of the separation came from each angular coordinate.
When the two points are very close, the haversine term is small and the atan2 expression preserves a useful relationship between that term and the central angle. A displayed distance may still round to zero if the selected precision is coarse. Keep the numeric angle and radius for small-scale work. At the opposite extreme, the term approaches one and the central angle approaches pi; the implementation protects the square-root endpoint from tiny floating-point excursions.
Near antipodal points, the length of the shortest arc is stable but the direction of a chosen great-circle route is not unique. A distance API should therefore avoid pretending that the scalar identifies a unique bearing. The calculator reports only length and central angle. If a navigation system needs a route, it must resolve the antipodal or near-antipodal choice with its own policy and source data.
A great-circle result is often used as a baseline for comparing locations, but a baseline is not a travel itinerary. A route can be longer because of coastlines, roads, airspace, terrain, restricted zones, weather, or chosen stops. Even an aircraft following a near-great-circle path may use a different surface, altitude, and operational plan. The calculator intentionally has no fields for those constraints and should not be presented as a travel-time estimator.
For an auditable record, name the ideal sphere, radius, coordinates, and date or source convention if the angular positions came from a dataset. Keep a real route calculation separate so a reviewer can tell which portion is geometric approximation and which portion is operational data. If the positions are private, avoid sharing precise coordinates merely because the local arithmetic itself is simple and deterministic.
Calculate the shortest spherical-surface distance and central angle between two latitude-longitude points on a sphere.
a = sin^2((phi2 - phi1)/2) + cos(phi1) cos(phi2) sin^2((lambda2 - lambda1)/2); central angle = 2 atan2(sqrt(a), sqrt(1-a)); distance = R central angle. Convert latitude and longitude differences from degrees to radians, evaluate the haversine central angle, and multiply that angle by the sphere radius to obtain the shorter great-circle arc distance.
Enter Sphere radius, Point 1 latitude, Point 1 longitude, Point 2 latitude, Point 2 longitude, then choose Calculate.
The surface is an ideal sphere with the entered positive radius. Latitude is geodetic-style angular latitude in degrees and longitude is angular longitude in degrees within the displayed ranges. The output follows the shorter great-circle arc and does not model ellipsoidal flattening, terrain, altitude, or route restrictions.
This calculator is part of the WorldCalculate library. Its formula, example, assumptions, input bounds, and output formatting follow the official methodology.
These WorldCalculate collections connect this tool with related questions while keeping each calculation separate and transparent.