/** @packageDocumentation * @module OrbitGT */ declare type float64 = number; import { Coordinate } from "./Coordinate"; /** * Class Line defines a line between two 3D XYZ points. * * @version 1.0 March 2010 */ /** @internal */ export declare class Line { /** The start point */ p0: Coordinate; /** The end point */ p1: Coordinate; /** * Create a new line. * @param p0 the start point. * @param p1 the end point. */ constructor(p0: Coordinate, p1: Coordinate); /** * Create a new line. * @return a new line. */ static create(): Line; /** * Create a new line. * @param p0 the start point. * @param p1 the end point. */ static fromPoints(p0: Coordinate, p1: Coordinate): Line; /** * Create a new line. * @param x0 the x of the start point. * @param y0 the y of the start point. * @param z0 the z of the start point. * @param x1 the x of the end point. * @param y1 the y of the end point. * @param z1 the z of the end point. */ static fromXYZ(x0: float64, y0: float64, z0: float64, x1: float64, y1: float64, z1: float64): Line; /** * Get the start point. * @return the start point. */ getPoint0(): Coordinate; /** * Get the end point. * @return the end point. */ getPoint1(): Coordinate; /** * Get a point along the line. * @param t the position of the point (0.0 at start and 1.0 at end). * @return a point. */ getPoint(t: float64): Coordinate; /** * Get a point along the line. * @param t the position of the point (0.0 at start and 1.0 at end). * @param point the result point (must be mutable). */ getPointTo(t: float64, point: Coordinate): void; /** * Get the X coordinate of a point along the line. * @param t the position of the point (0.0 at start and 1.0 at end). * @return the coordinate. */ getPointX(t: float64): float64; /** * Get the Y coordinate of a point along the line. * @param t the position of the point (0.0 at start and 1.0 at end). * @return the coordinate. */ getPointY(t: float64): float64; /** * Get the Z coordinate of a point along the line. * @param t the position of the point (0.0 at start and 1.0 at end). * @return the coordinate. */ getPointZ(t: float64): float64; /** * Get a point along the line. * @param d the distance of the point (0.0 at start). * @return a point. */ getPointAtDistance(d: float64): Coordinate; /** * Get a point along the line. * @param d the distance of the point (0.0 at start). * @param point the result point (must be mutable). */ getPointAtDistanceTo(d: float64, point: Coordinate): void; /** * Get the position for a fixed x value. * @param x the x value. * @return the position on the line. */ getPointAtX(x: float64): float64; /** * Get a point along the line. * @param x the x value. * @param point the result point (must be mutable). */ getPointAtXTo(x: float64, point: Coordinate): void; /** * Get the position for a fixed y value. * @param y the y value. * @return the position on the line. */ getPointAtY(y: float64): float64; /** * Get a point along the line. * @param y the y value. * @param point the result point (must be mutable). */ getPointAtYTo(y: float64, point: Coordinate): void; /** * Get the position for a fixed z value. * @param z the z value. * @return the position on the line. */ getPointAtZ(z: float64): float64; /** * Get a point along the line. * @param z the z value. * @param point the result point (must be mutable). */ getPointAtZTo(z: float64, point: Coordinate): void; /** * Get the direction vector (P1-P0). * @return the direction vector. */ getDirection(): Coordinate; /** * Get the direction vector (P1-P0). * @param direction the result direction vector. */ getDirectionTo(direction: Coordinate): void; /** * Get the direction vector (P1-P0). * @return the direction vector. */ getDifference(): Coordinate; /** * Swap the orientation of the line (create a line from point1 to point0). * @return a new line. */ swapDirection(): Line; /** * Get the squared length of the segment. * @return the squared length of the segment. */ getSquaredLength(): float64; /** * Get the length of the segment. * @return the length of the segment. */ getLength(): float64; /** * Project a point on the segment. * @param point the point to project. * @return the position of the projected point. */ getProjection(point: Coordinate): float64; /** * Project a point on the segment. * @param point the point to project. * @return the projected point. */ getProjectionPoint(point: Coordinate): Coordinate; /** * Get the distance from a point to the line. * @param point the point. * @return the distance. */ getDistance(point: Coordinate): float64; /** * Get the distance from a point to the segment between point 0 and point 1. * @param point the point. * @return the distance. */ getSegmentDistance(point: Coordinate): float64; /** * Check if the denominator of an intersection is zero (parallel lines). * @param value the denominator value. * @return true if zero (like -7.105427357601002E-15, -3.8944125702045085E-10 or -3.808708481679941E-9 for perfectly parallel lines). */ static isZero(value: float64): boolean; /** * Check if the lines is parallel with another line. * @param line the other line. * @return true if the lines are parallel. */ isParallel(line: Line): boolean; /** * Intersect with another line. * The two lines should not be parallel, check with 'isParallel' first ! * @param line the line the intersect with. * @return the position of the intersection point. */ getIntersection(line: Line): float64; /** * Intersect with another line. * @param line the line the intersect with. * @return the intersection point (null if the lines are parallell). */ getIntersectionPoint(line: Line): Coordinate; /** * Interpolate a point. * @param point1 the first point on the line. * @param point2 the second point on the line. * @param t the point parameter. * @param point the target point. */ static interpolate(point1: Coordinate, point2: Coordinate, t: float64, point: Coordinate): void; /** * The standard toString method. * @see Object#toString */ toString(): string; } export {}; //# sourceMappingURL=Line.d.ts.map