/** A N x N matrix. */ export interface Mat { /** Adds RHS to this matrix. */ add(rhs: Mat): this; /** Subtracts RHS from this matrix. */ sub(rhs: Mat): this; /** Multiplies RHS to this. */ mul(rhs: Mat): this; /** Scales this matrix by given factor. */ scale(factor: number): this; /** Transposes this matrix. */ transpose(): this; /** Inverts this matrix. */ invert(): boolean; /** Calculates the determinant of this matrix. */ det(): number; } /** A N-d vector. */ export interface Vec { /** Returns the length of Vec. */ readonly length: N; /** Adds RHS to this vector. */ add(rhs: Vec): this; /** Subtracts RHS from this vector. */ sub(rhs: Vec): this; /** Premultiplies matrix to this vector. */ mul(m: Mat): this; /** Computes the dot product of this vector with RHS. */ dot(rhs: Vec): number; /** Computes the linear interpolation between this vector and RHS. */ lerp(rhs: Vec, t: number): this; /** Scales this vector by given factor. */ scale(factor: number): this; /** Normalizes this vector. */ normalize(): boolean; } /** Quaternion interface. */ export interface IQuat { /** Returns the length of Quat. */ readonly length: 4; /** Assigns the Hamilton product with RHS to this. */ mul(rhs: IQuat): this; /** Rotates given 3D vector mutably using this. */ rotate(v: Vec<3>): Vec<3>; /** Computes the dot product of this with RHS. */ dot(rhs: IQuat): number; /** Computes the linear interpolation between this and RHS. */ lerp(rhs: IQuat, t: number): this; /** Computes the shperic interpolation between this and RHS. */ slerp(rhs: IQuat, t: number): this; /** Normalizes this. */ normalize(): boolean; /** Inverts this. */ invert(): boolean; }