Skip to main content

greatCircleStepRadians

The longest arc, in radians, that a straight line on the screen can stand for on a globe of radiusPixels while straying at most tolerancePixels from it.

This is a function exported by @mapcairn/core, checked against version 0.2.0.

Signature​

import { greatCircleStepRadians } from "@mapcairn/core";

function greatCircleStepRadians(radiusPixels: number, tolerancePixels?: number): number;

Parameters​

  • radiusPixels (number)
  • tolerancePixels? (number)

Returns​

number

Remarks​

A chord across an arc of angle θ on a sphere of radius R is at most R(1 - cos(θ/2)), about Rθ²/8, from the arc, and projecting it to the screen never makes that gap larger. So θ = √(8 · tolerance / R).

Source: packages/core/src/globe/greatCircle.ts:56