gis-tools-ts
Version:
A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.
58 lines • 2.81 kB
TypeScript
import type { VectorPoint } from 's2json-spec';
/** Constants for orient2d */
export interface Orient2dConstants {
B: Float64Array;
C1: Float64Array;
C2: Float64Array;
D: Float64Array;
u: Float64Array;
}
/**
* Check the orientation of c relative to the line through a and b
* @param a - first point
* @param b - second point
* @param c - comparison point
* @returns - a positive value if the points a, b, and c occur in counterclockwise order
* (c lies to the left of the directed line defined by points a and b).
* - Returns a negative value if they occur in clockwise order (c lies to the right of the directed line ab).
* - Returns zero if they are collinear.
*/
export declare function orient2dVector(a: VectorPoint, b: VectorPoint, c: VectorPoint): number;
/**
* Check the orientation of c relative to the line through a and b
* @param ax - x coordinate of first point
* @param ay - y coordinate of first point
* @param bx - x coordinate of second point
* @param by - y coordinate of second point
* @param cx - x coordinate of comparison point
* @param cy - y coordinate of comparison point
* @returns - a positive value if the points a, b, and c occur in counterclockwise order
* (c lies to the left of the directed line defined by points a and b).
* - Returns a negative value if they occur in clockwise order (c lies to the right of the directed line ab).
* - Returns zero if they are collinear.
*/
export declare function orient2d(ax: number, ay: number, bx: number, by: number, cx: number, cy: number): number;
/**
* @param a - first point
* @param b - second point
* @param c - comparison point
* @returns - a positive value if the points a, b, and c occur in counterclockwise order
* (c lies to the left of the directed line defined by points a and b).
* - Returns a negative value if they occur in clockwise order (c lies to the right of the directed line ab).
* - Returns zero if they are collinear.
*/
export declare function orient2dfastVector(a: VectorPoint, b: VectorPoint, c: VectorPoint): number;
/**
* @param ax - x coordinate of first point
* @param ay - y coordinate of first point
* @param bx - x coordinate of second point
* @param by - y coordinate of second point
* @param cx - x coordinate of comparison point
* @param cy - y coordinate of comparison point
* @returns - a positive value if the points a, b, and c occur in counterclockwise order
* (c lies to the left of the directed line defined by points a and b).
* - Returns a negative value if they occur in clockwise order (c lies to the right of the directed line ab).
* - Returns zero if they are collinear.
*/
export declare function orient2dfast(ax: number, ay: number, bx: number, by: number, cx: number, cy: number): number;
//# sourceMappingURL=orient2d.d.ts.map