/** * Great-circle helpers for arc and route marks. * * Why this exists rather than drawing straight lines: a straight segment between * two points on a projected map is not the path anything travels. Tokyo to New * York arcs over the Arctic; in Web Mercator the true route looks like a curve * bending sharply north, and a straight line between the two is both wrong and * misleadingly long. Many libraries draw the straight line and hope. * * The output is a GeoJSON LineString in lon/lat, deliberately, so that d3-geo's * own clipping and antimeridian cutting handle the hard cases: a Tokyo to Los * Angeles arc crossing the antimeridian is split into two rendered segments * automatically instead of streaking back across the whole map. * * @module geo/Geodesic */ import type { LineString } from 'geojson'; import type { LonLat, WorldPoint } from '../types'; /** * Angular distance between two points, in degrees along a great circle. */ export declare function angularDistance(from: LonLat, to: LonLat): number; /** * How many intermediate points a geodesic needs. * * Scaled by arc length so a 200 km hop is not sampled as densely as a * trans-Pacific route, and clamped so neither end degenerates: too few points * makes a great circle look like a polyline, too many wastes memory on every arc * in a 5,000-route network. */ export declare function segmentsFor(degrees: number, { min, max, perDegree }?: { min?: number | undefined; max?: number | undefined; perDegree?: number | undefined; }): number; /** * Sample a great circle between two points. * * Returns lon/lat coordinates including both endpoints. */ export declare function greatCircle(from: LonLat, to: LonLat, segments?: number): LonLat[]; /** * A great circle as a GeoJSON LineString, ready to hand to a d3 path generator. */ export declare function greatCircleLine(from: LonLat, to: LonLat, segments?: number): LineString; /** * The midpoint of a great circle, useful for anchoring a tooltip or a label on an * arc. */ export declare function greatCircleMidpoint(from: LonLat, to: LonLat): LonLat; /** * A quadratic bezier through world space, bulging perpendicular to the chord. * * This is the decorative alternative to a true geodesic, and it is worth being * explicit that it is decorative: the curve is not a path anything follows, and * its height carries no meaning. It reads well for hub-and-spoke marketing maps * and for keeping many parallel routes visually distinguishable, which is why it * is offered at all. * * The bulge is always drawn to the same side of the chord (left, in screen terms) * so that a set of arcs fans consistently instead of alternating. * * @param curvature 0 is a straight chord; 0.3 is a gentle arc; 1 is extreme. */ export declare function bezierArc(from: WorldPoint, to: WorldPoint, curvature: number): string; /** * Total length of a projected polyline in world pixels, used to seed * stroke-dasharray for draw-on animations. */ export declare function polylineLength(points: WorldPoint[]): number; //# sourceMappingURL=Geodesic.d.ts.map