import { Vertex } from './vertex'; import { Vector } from './vector'; /** * A polygonal edge in 2-dimensional space, effectively a line segment. */ export declare class Edge { /** * The starting vertex of the edge. */ start: Vertex; /** * The ending vertex of the edge. */ end: Vertex; /** * Constructs an edge with specified starting and ending vertices. * @param start A vertex representing the starting vertex of the edge. * @param end A vertex representing the ending vertex of the edge. */ constructor(start: Vertex, end: Vertex); /** * Creates a new Edge object with the same properties of this one. * @returns A new Edge object. */ copy(): Edge; /** * Creates a user-friendly formatted string for the edge. Elements are contained in parenthesis, separated by * commas and formatted as user-friendly vertices. * @returns A formatted string representing the edge. */ toString(): string; /** * Creates a displacement vector between the start and end of the edge. * @param reverse Creates a displacement vector in the opposite direction if true. * @returns A displacement vector. */ direction(reverse?: boolean): Vector; /** * Creates a vector normal to the edge. The method operates under the assumption that the edge is part of a CCW polygon. * @param clockwise Creates a normal vector in the opposite direction. * @returns A normal vector. */ normal(clockwise?: boolean): Vector; /** * Calculates the length of the edge. * @returns The length of the edge. */ length(): number; /** * Calculates the point of intersection between this and another edge. * @param edge The edge to intersect with this one. * @returns The point of intersection if it exists, null otherwise. */ intersectEdge(edge: Edge): Vertex; } /** * Shorthand constructor for an Edge object. * @param start The starting vertex of the edge. * @param end The ending vertex of the edge. * @returns A new Edge instance. */ export declare function edge(start: Vertex, end: Vertex): Edge;