ts-scikit
Version:
A scientific toolkit written in Typescript
65 lines (64 loc) • 2.07 kB
TypeScript
import { Tuple4 } from './tuple4';
import { Point3 } from './point3';
import { Vector3 } from './vector3';
/**
* A point with 4 coordinates: x, y, z, and w.
*/
export declare class Point4 extends Tuple4 {
/**
* Constructs a new point from a specified 3D point.
* @param p the 3D point.
*/
static FromPoint3(p: Point3): Point4;
/**
* Constructs a new point.
* @param x the x-coordinate.
* @param y the y-coordinate.
* @param z the z-coordinate.
* @param w the w-coordinate.
*/
constructor(x: number, y: number, z: number, w: number);
/**
* Returns the point q = p + v for this point p and specified vector v.
* @param v the vector v.
* @returns the point q = p + v.
*/
plus(v: Vector3): Point4;
/**
* Returns the point q = p - v for this point p and specified vector v.
* @param v the vector v.
* @returns the point q = p - v.
*/
minus(v: Vector3): Point4;
/**
* Moves this point p by adding the specified vector v.
* @param v the vector v.
* @returns a reference to this point q += v, moved.
*/
plusEquals(v: Vector3): this;
/**
* Moves this point p by subtracting the specified vector v
* @param v the vector v.
* @returns a reference to this point q -= v, moved.
*/
minusEquals(v: Vector3): this;
/**
* Returns the homogenized point equivalent to this point.
* Homogenization is division of the coordinates (x, y, z, w) by w.
* @returns the homogenized point.
*/
homogenize(): Point4;
/**
* Homogenizes this point.
* Homogenization is division of the coordinates (x, y, z, w) by w.
* @returns a reference to this point, homogenized.
*/
homogenizeEquals(): 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: Point4): Point4;
}