import { Point } from "../geometries/point.ts"; import { Matrix2d } from "./matrix2d.ts"; import { Vector2d } from "./vector2d.ts"; import { Vector3d } from "./vector3d.ts"; type SixteenNumbers = [ number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number ]; type ConstructorArg = [Matrix3d] | SixteenNumbers | [undefined] | []; /** * a 4x4 Matrix3d Object * @category Math */ export declare class Matrix3d { /** * The matrix values */ val: Float32Array; /** * Constructs a new Matrix3d object. * @param value - The values to initialize the matrix with. */ constructor(...value: ConstructorArg); /** * Gets the tx component of the matrix. * @returns The tx component of the matrix. */ get tx(): number; /** * Gets the ty component of the matrix. * @returns The ty component of the matrix. */ get ty(): number; /** * Gets the tz component of the matrix. * @returns The tz component of the matrix. */ get tz(): number; /** * reset the transformation matrix to the identity matrix (no transformation).
* the identity matrix and parameters position :
* * @returns Reference to this object for method chaining */ identity(): this; /** * Set the matrix to the specified value. * @param values - The matrix components. * @returns Reference to this object for method chaining */ setTransform(...values: SixteenNumbers): this; /** * Copies over the values from another me.Matrix3d. * @param m - the matrix object to copy from * @returns Reference to this object for method chaining */ copy(m: Matrix3d): this; /** * Copies over the upper-left 2x2 values from the given me.Matrix2d * @param m - the matrix object to copy from * @returns Reference to this object for method chaining */ fromMat2d(m: Matrix2d): this; /** * multiply both matrix * @param m - Other matrix (Matrix3d or Matrix2d) * @returns Reference to this object for method chaining */ multiply(m: Matrix3d | Matrix2d): this; /** * Transpose the value of this matrix. * @returns Reference to this object for method chaining */ transpose(): this; /** * invert this matrix, causing it to apply the opposite transformation. * @returns Reference to this object for method chaining */ invert(): this; /** * apply the current transform to the given 2d or 3d vector or point * @param v - the vector object to be transformed * @returns result vector object. */ apply(v: Vector3d | Vector2d | Point): Vector2d | Point | Vector3d; /** * apply the inverted current transform to the given 2d or 3d vector * @param v - the vector object to be transformed * @returns result vector object. */ applyInverse(v: Vector3d | Vector2d): Vector2d | Vector3d; /** * generate an orthogonal projection matrix, with the result replacing the current matrix *
* @param left - farthest left on the x-axis * @param right - farthest right on the x-axis * @param bottom - farthest down on the y-axis * @param top - farthest up on the y-axis * @param near - distance to the near clipping plane along the -Z axis * @param far - distance to the far clipping plane along the -Z axis * @returns Reference to this object for method chaining */ ortho(left: number, right: number, bottom: number, top: number, near: number, far: number): this; /** * generate a perspective projection matrix, with the result replacing the current matrix * @param fov - vertical field of view in radians * @param aspect - aspect ratio (width / height) * @param near - distance to the near clipping plane along the -Z axis * @param far - distance to the far clipping plane along the -Z axis * @returns Reference to this object for method chaining */ perspective(fov: number, aspect: number, near: number, far: number): this; /** * scale the matrix * @param x - a number representing the abscissa of the scaling vector. * @param [y] - a number representing the ordinate of the scaling vector. * @param [z] - a number representing the depth vector * @returns Reference to this object for method chaining */ scale(x: number, y?: number, z?: number): this; /** * adds a 2D scaling transformation. * @param v - scaling vector * @returns Reference to this object for method chaining */ scaleV(v: Vector3d): this; /** * specifies a 2D scale operation using the [sx, 1] scaling vector * @param x - x scaling vector * @returns Reference to this object for method chaining */ scaleX(x: number): this; /** * specifies a 2D scale operation using the [1,sy] scaling vector * @param y - y scaling vector * @returns Reference to this object for method chaining */ scaleY(y: number): this; /** * rotate this matrix (counter-clockwise) by the specified angle (in radians). * @param angle - Rotation angle in radians. * @param [v] - the axis to rotate around (defaults to Z axis) * @returns Reference to this object for method chaining */ rotate(angle: number, v?: Vector3d): this; /** * translate the matrix position using the given vector * @param x - a number representing the abscissa of the vector, or a vector object * @param [y] - a number representing the ordinate of the vector. * @param [z] - a number representing the depth of the vector * @returns Reference to this object for method chaining */ translate(x: number, y: number, z?: number): Matrix3d; translate(vector: Vector3d | Vector2d): Matrix3d; /** * Check if the matrix is an identity matrix. * @returns true if the matrix is an identity matrix */ isIdentity(): boolean; /** * return true if the two matrices are identical * @param m - the other matrix * @returns true if both are equals */ equals(m: Matrix3d): boolean; /** * return a Matrix2d projection of this Matrix3d * @param [out] - an optional Matrix2d to reuse (avoids allocation) * @returns a Matrix2d containing the upper-left 2D affine components */ toMatrix2d(out?: Matrix2d): Matrix2d; /** * Clone the Matrix * @returns a cloned matrix */ clone(): Matrix3d; /** * return an array representation of this Matrix * @returns internal matrix values */ toArray(): Float32Array; /** * convert the object to a string representation * @returns stringified representation */ toString(): string; } export declare const matrix3dPool: import("../system/pool.ts").Pool; export {}; //# sourceMappingURL=matrix3d.d.ts.map