1 | import L from "leaflet";
|
2 | export interface GeodesicOptions extends L.PolylineOptions {
|
3 | wrap?: boolean;
|
4 | steps?: number;
|
5 | radius?: number;
|
6 | }
|
7 | export interface WGS84Vector extends L.LatLngLiteral {
|
8 | bearing: number;
|
9 | }
|
10 | export interface GeoDistance {
|
11 | distance: number;
|
12 | initialBearing: number;
|
13 | finalBearing: number;
|
14 | }
|
15 | export declare class GeodesicCore {
|
16 | readonly options: GeodesicOptions;
|
17 | readonly ellipsoid: {
|
18 | a: number;
|
19 | b: number;
|
20 | f: number;
|
21 | };
|
22 | constructor(options?: GeodesicOptions);
|
23 | toRadians(degree: number): number;
|
24 | toDegrees(radians: number): number;
|
25 | /**
|
26 | * implements scientific modulus
|
27 | * source: http://www.codeavenger.com/2017/05/19/JavaScript-Modulo-operation-and-the-Caesar-Cipher.html
|
28 | * @param n
|
29 | * @param p
|
30 | * @return
|
31 | */
|
32 | mod(n: number, p: number): number;
|
33 | /**
|
34 | * source: https://github.com/chrisveness/geodesy/blob/master/dms.js
|
35 | * @param degrees arbitrary value
|
36 | * @return degrees between 0..360
|
37 | */
|
38 | wrap360(degrees: number): number;
|
39 | /**
|
40 | * general wrap function with arbitrary max value
|
41 | * @param degrees arbitrary value
|
42 | * @param max
|
43 | * @return degrees between `-max`..`+max`
|
44 | */
|
45 | wrap(degrees: number, max?: number): number;
|
46 | /**
|
47 | * Vincenty direct calculation.
|
48 | * based on the work of Chris Veness (https:
|
49 | * source: https:
|
50 | *
|
51 | * @param start starting point
|
52 | * @param bearing initial bearing (in degrees)
|
53 | * @param distance distance from starting point to calculate along given bearing in meters.
|
54 | * @param maxInterations How many iterations can be made to reach the allowed deviation (`ε`), before an error will be thrown.
|
55 | * @return Final point (destination point) and bearing (in degrees)
|
56 | */
|
57 | direct(start: L.LatLng, bearing: number, distance: number, maxInterations?: number): WGS84Vector;
|
58 | |
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 | inverse(start: L.LatLng, dest: L.LatLng, maxInterations?: number, mitigateConvergenceError?: boolean): GeoDistance;
|
68 | |
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 | intersection(firstPos: L.LatLng, firstBearing: number, secondPos: L.LatLng, secondBearing: number): L.LatLng | null;
|
80 | midpoint(start: L.LatLng, dest: L.LatLng): L.LatLng;
|
81 | }
|
82 |
|
\ | No newline at end of file |