UNPKG

ts-scikit

Version:

A scientific toolkit written in Typescript

54 lines (53 loc) 1.77 kB
import { Tuple3 } from './tuple3'; import { Vector3 } from './vector3'; /** * A point with 3 coordinates: x, y, and z. */ export declare class Point3 extends Tuple3 { /** * Constructs a new point. * @param x the x-coordinate. * @param y the y-coordinate. * @param z the z-coordinate. */ constructor(x: number, y: number, z: number); /** * Returns the point q = p + v for this point p and the specified vector v. * @param v the vector v. * @returns the point q = p + v. */ plus(v: Vector3): Point3; /** * Moves this point p by adding the specified vector v. * @param v the vector v. * @returns a reference to this point, moved along vector v. */ plusEquals(v: Vector3): this; /** * Returns the point or vector q = p - v for this point p. * If v is a vector, q is a point translated along vector v. * If v is a point, q is the vector difference. * @param v the point or vector v. * @returns the vector or point q = p - v. */ minus(v: Vector3 | Point3): Point3 | Vector3; /** * Moves this point by subtracting the specified vector v * @param v the vector v. * @returns a reference to this point, moved along vector v. */ minusEquals(v: Vector3): this; /** * Returns an affine combination of this point p and the specified point q. * @param a the weight of the point q. * @param q the point q. * @returns the affine combination (1 - a) * p + a * q. */ affine(a: number, q: Point3): Point3; /** * Computes the distance between this point p and the specified point q. * @param q the point q. * @returns the distance |q - p|. */ distanceTo(q: Point3): number; }