/** * A JavaScript array with 3 values or a Float32Array with 3 values. * When created by the library will create the default type which is `Float32Array` * but can be set by calling {@link module :twgl/v3.setDefaultType}. */ export type Vec3 = (number[] | Float32Array); /** * Adds two vectors; assumes a and b have the same dimension. * @param {module:twgl/v3.Vec3} a Operand vector. * @param {module:twgl/v3.Vec3} b Operand vector. * @param {module:twgl/v3.Vec3} [dst] vector to hold result. If not new one is created. * @return {module:twgl/v3.Vec3} A vector tha tis the sum of a and b. * @memberOf module:twgl/v3 */ export function add(a: any, b: any, dst?: any): any; /** * Calculates a + k*b; assumes the vectors a and b have the same dimension. * @param {module:twgl/v3.Vec3} a Operand vector. * @param {module:twgl/v3.Vec3} k Scalar coefficient. * @param {module:twgl/v3.Vec3} b Operand vector. * @param {module:twgl/v3.Vec3} [dst] vector to hold result. If not new one is created. * @return {module:twgl/v3.Vec3} A vector tha tis the sum of a and b. * @memberOf module:twgl/v3 */ export function addMul(a: any, k: any, b: any, dst?: any): any; /** * Copies a vector. * @param {module:twgl/v3.Vec3} v The vector. * @param {module:twgl/v3.Vec3} [dst] vector to hold result. If not new one is created. * @return {module:twgl/v3.Vec3} A copy of v. * @memberOf module:twgl/v3 */ export function copy(v: any, dst?: any): any; /** * Creates a vec3; may be called with x, y, z to set initial values. * @param {number} [x] Initial x value. * @param {number} [y] Initial y value. * @param {number} [z] Initial z value. * @return {module:twgl/v3.Vec3} the created vector * @memberOf module:twgl/v3 */ export function create(x?: number | undefined, y?: number | undefined, z?: number | undefined): any; /** * Computes the cross product of two vectors; assumes both vectors have * three entries. * @param {module:twgl/v3.Vec3} a Operand vector. * @param {module:twgl/v3.Vec3} b Operand vector. * @param {module:twgl/v3.Vec3} [dst] vector to hold result. If not new one is created. * @return {module:twgl/v3.Vec3} The vector of a cross b. * @memberOf module:twgl/v3 */ export function cross(a: any, b: any, dst?: any): any; /** * Computes the distance between 2 points * @param {module:twgl/v3.Vec3} a vector. * @param {module:twgl/v3.Vec3} b vector. * @return {number} distance between a and b * @memberOf module:twgl/v3 */ export function distance(a: any, b: any): number; /** * Computes the square of the distance between 2 points * @param {module:twgl/v3.Vec3} a vector. * @param {module:twgl/v3.Vec3} b vector. * @return {number} square of the distance between a and b * @memberOf module:twgl/v3 */ export function distanceSq(a: any, b: any): number; /** * Divides a vector by another vector (component-wise); assumes a and * b have the same length. * @param {module:twgl/v3.Vec3} a Operand vector. * @param {module:twgl/v3.Vec3} b Operand vector. * @param {module:twgl/v3.Vec3} [dst] vector to hold result. If not new one is created. * @return {module:twgl/v3.Vec3} The vector of quotients of entries of a and * b. * @memberOf module:twgl/v3 */ export function divide(a: any, b: any, dst?: any): any; /** * Divides a vector by a scalar. * @param {module:twgl/v3.Vec3} v The vector. * @param {number} k The scalar. * @param {module:twgl/v3.Vec3} [dst] vector to hold result. If not new one is created. * @return {module:twgl/v3.Vec3} The scaled vector. * @memberOf module:twgl/v3 */ export function divScalar(v: any, k: number, dst?: any): any; /** * Computes the dot product of two vectors; assumes both vectors have * three entries. * @param {module:twgl/v3.Vec3} a Operand vector. * @param {module:twgl/v3.Vec3} b Operand vector. * @return {number} dot product * @memberOf module:twgl/v3 */ export function dot(a: any, b: any): number; /** * Performs linear interpolation on two vectors. * Given vectors a and b and interpolation coefficient t, returns * a + t * (b - a). * @param {module:twgl/v3.Vec3} a Operand vector. * @param {module:twgl/v3.Vec3} b Operand vector. * @param {number} t Interpolation coefficient. * @param {module:twgl/v3.Vec3} [dst] vector to hold result. If not new one is created. * @return {module:twgl/v3.Vec3} The linear interpolated result. * @memberOf module:twgl/v3 */ export function lerp(a: any, b: any, t: number, dst?: any): any; /** * Performs linear interpolation on two vectors. * Given vectors a and b and interpolation coefficient vector t, returns * a + t * (b - a). * @param {module:twgl/v3.Vec3} a Operand vector. * @param {module:twgl/v3.Vec3} b Operand vector. * @param {module:twgl/v3.Vec3} t Interpolation coefficients vector. * @param {module:twgl/v3.Vec3} [dst] vector to hold result. If not new one is created. * @return {module:twgl/v3.Vec3} the linear interpolated result. * @memberOf module:twgl/v3 */ export function lerpV(a: any, b: any, t: any, dst?: any): any; /** * Computes the length of vector * @param {module:twgl/v3.Vec3} v vector. * @return {number} length of vector. * @memberOf module:twgl/v3 */ export function length(v: any): number; /** * Computes the square of the length of vector * @param {module:twgl/v3.Vec3} v vector. * @return {number} square of the length of vector. * @memberOf module:twgl/v3 */ export function lengthSq(v: any): number; /** * Return max values of two vectors. * Given vectors a and b returns * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])]. * @param {module:twgl/v3.Vec3} a Operand vector. * @param {module:twgl/v3.Vec3} b Operand vector. * @param {module:twgl/v3.Vec3} [dst] vector to hold result. If not new one is created. * @return {module:twgl/v3.Vec3} The max components vector. * @memberOf module:twgl/v3 */ export function max(a: any, b: any, dst?: any): any; /** * Return min values of two vectors. * Given vectors a and b returns * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])]. * @param {module:twgl/v3.Vec3} a Operand vector. * @param {module:twgl/v3.Vec3} b Operand vector. * @param {module:twgl/v3.Vec3} [dst] vector to hold result. If not new one is created. * @return {module:twgl/v3.Vec3} The min components vector. * @memberOf module:twgl/v3 */ export function min(a: any, b: any, dst?: any): any; /** * Multiplies a vector by a scalar. * @param {module:twgl/v3.Vec3} v The vector. * @param {number} k The scalar. * @param {module:twgl/v3.Vec3} [dst] vector to hold result. If not new one is created. * @return {module:twgl/v3.Vec3} The scaled vector. * @memberOf module:twgl/v3 */ export function mulScalar(v: any, k: number, dst?: any): any; /** * Multiplies a vector by another vector (component-wise); assumes a and * b have the same length. * @param {module:twgl/v3.Vec3} a Operand vector. * @param {module:twgl/v3.Vec3} b Operand vector. * @param {module:twgl/v3.Vec3} [dst] vector to hold result. If not new one is created. * @return {module:twgl/v3.Vec3} The vector of products of entries of a and * b. * @memberOf module:twgl/v3 */ export function multiply(a: any, b: any, dst?: any): any; /** * Negates a vector. * @param {module:twgl/v3.Vec3} v The vector. * @param {module:twgl/v3.Vec3} [dst] vector to hold result. If not new one is created. * @return {module:twgl/v3.Vec3} -v. * @memberOf module:twgl/v3 */ export function negate(v: any, dst?: any): any; /** * Divides a vector by its Euclidean length and returns the quotient. * @param {module:twgl/v3.Vec3} a The vector. * @param {module:twgl/v3.Vec3} [dst] vector to hold result. If not new one is created. * @return {module:twgl/v3.Vec3} The normalized vector. * @memberOf module:twgl/v3 */ export function normalize(a: any, dst?: any): any; /** * A JavaScript array with 3 values or a Float32Array with 3 values. * When created by the library will create the default type which is `Float32Array` * but can be set by calling {@link module:twgl/v3.setDefaultType}. * @typedef {(number[]|Float32Array)} Vec3 * @memberOf module:twgl/v3 */ /** * Sets the type this library creates for a Vec3 * @param {constructor} ctor the constructor for the type. Either `Float32Array` or `Array` * @return {constructor} previous constructor for Vec3 * @memberOf module:twgl/v3 */ export function setDefaultType(ctor: constructor): constructor; /** * Subtracts two vectors. * @param {module:twgl/v3.Vec3} a Operand vector. * @param {module:twgl/v3.Vec3} b Operand vector. * @param {module:twgl/v3.Vec3} [dst] vector to hold result. If not new one is created. * @return {module:twgl/v3.Vec3} A vector that is the difference of a and b. * @memberOf module:twgl/v3 */ export function subtract(a: any, b: any, dst?: any): any; /** * Inverts elements of a. */ export function invert(a: any, dst: any): any;