xyzw · version 0.9.7

/source/Math.js:ExtMath extends Math4-4

Import

import { ExtMath } from 'xyzw/source/Math.js'

.clamp(n, min, max)15-17

Returns the clamped value of n

Signature

{number} ExtMath.clamp({number} n, {number} min, {number} max)

Arguments

{number} n

The value

{number} min

The minimal value

{number} max

The maximal value

Returns

{number}

.mix(a, b, bf)26-28

Returns the linear interpolation of a and b

Signature

{number} ExtMath.mix({number} a, {number} b, {number} bf)

Arguments

{number} a

The first value

{number} b

The second value

{number} bf

The weight of the second value

Returns

{number}

.reflect(n, r)36-38

Returns the reflected value of n against r

Signature

{number} ExtMath.reflect({number} n, {number} r)

Arguments

{number} n

The value

{number} r

The reflection value

Returns

{number}

.range(min, max, intervals)47-52

Returns a random number between min and max

Signature

{number} ExtMath.range({number} min, {number} max [, {int} intervals])

Arguments

{number} min

The minimal value

{number} max

The maximal value

{int} intervals optional

The number of discreet intervals

Returns

{number}

.overlap(a0, a1, b0, b1)63-68

Returns true if ranges (a0 a1) and (b0 b1) overlap, false otherwise

Signature

{boolean} ExtMath.overlap({number} a0, {number} a1, {number} b0, {number} b1)

Arguments

{number} a0

The first limit of range a

{number} a1

The second limit of range a

{number} b0

The first limit of range b

{number} b1

The second limit of range b

Returns

{boolean}

/source/Matrix2.js:Matrix24-402

2x2 transformations

Import

import { Matrix2 } from 'xyzw/source/Matrix2.js'

.Rotation(rad, target)12-25

Returns a instance of z-axis rotation

Signature

{Matrix2} Matrix2.Rotation({number} rad [, {Matrix2} target])

Arguments

{number} rad

The rotation in radians

{Matrix2} target optional

The target instance

Returns

{Matrix2}

.Scale(v, target)33-43

Returns a instance of scale vector

Signature

{Matrix2} Matrix2.Scale({Vector2} v [, {Matrix2} target])

Arguments

{Vector2} v

The source

{Matrix2} target optional

The target instance

Returns

{Matrix2}

.Vector2(x, y, target)52-60

Returns a new instance of axes (x, y)

Signature

{Matrix2} Matrix2.Vector2({Vector2} x [, {Vector2} y [, {Matrix2} target]])

Arguments

{Vector2} x

The x-axis vector

{Vector2} y optional

The y-axis vector

{Matrix2} target optional

The target instance

Returns

{Matrix2}

.Matrix3(m, target)69-78

Returns a new instance of converted m The instance will be cropped to 2x2 by removing the third row & column of m

Signature

{Matrix2} Matrix2.Matrix3({Matrix3} m [, {Matrix2} target])

Arguments

{Matrix3} m

The source

{Matrix2} target optional

The target instance

Returns

{Matrix2}

.Add(a, b, target)88-90

Returns the sum of a and b (a+b)

Signature

{Matrix2} Matrix2.Add({Matrix2} a, {Matrix2} b [, {Matrix2} target])

Arguments

{Matrix2} a

The first summand

{Matrix2} b

The second summand

{Matrix2} target optional

The target instance

Returns

{Matrix2}

.Subtract(a, b, target)99-101

Returns the difference of a and b (a-b)

Signature

{Matrix2} Matrix2.Subtract({Matrix2} a, {Matrix2} b [, {Matrix2} target])

Arguments

{Matrix2} a

The minuend

{Matrix2} b

The subtrahend

{Matrix2} target optional

The target instance

Returns

{Matrix2}

.Multiply(a, b, target)110-112

Returns the concatenation of a and b (a*b)

Signature

{Matrix2} Matrix2.Multiply({Matrix2} a, {Matrix2} b [, {Matrix2} target])

Arguments

{Matrix2} a

The first matrix

{Matrix2} b

The second matrix

{Matrix2} target optional

The target instance

Returns

{Matrix2}

.Inverse(m, target)122-126

Returns the inverse of m Returns null if m is assumed to be singular, the new instance otherwise

Signature

{Matrix2|null} Matrix2.Inverse({Matrix2} m [, {Matrix2} target])

Arguments

{Matrix2} m

The source

{Matrix2} target optional

The target instance

Returns

{Matrix2|null}

.Transpose(m, target)134-136

Returns the transpose of m

Signature

{Matrix2} Matrix2.Transpose({Matrix2} m [, {Matrix2} target])

Arguments

{Matrix2} m

The source

{Matrix2} target optional

The target instance

Returns

{Matrix2}

.Copy(m, target)144-146

Returns a copy of m

Signature

{Matrix2} Matrix2.Copy({Matrix2} m [, {Matrix2} target])

Arguments

{Matrix2} m

The source

{Matrix2} target optional

The target instance

Returns

{Matrix2}

.isEQ(a, b)155-165

Returns true if a and b are equal, false otherwise (a==b)

Signature

{boolean} Matrix2.isEQ({Matrix2} a, {Matrix2} b)

Arguments

{Matrix2} a

The first matrix

{Matrix2} b

The second matrix

Returns

{boolean}

#constructor(n)174-183

Creates a new instance

Signature

{undefined} Matrix2#constructor([{number[]} n])

Arguments

{number[]} n optional

Array representing 2x2 column-major ordered components Arrays of length !== 4 will return the identity matrix

Returns

No return value

#n182-182

The array representation The 4 column-major ordered components n[0]:n00 n[2]:n01 n[1]:n10 n[3]:n11

Signature

{number[]} Matrix2#n

#define(n)192-196

Redefines the instance

Signature

{Matrix2} Matrix2#define([{number[]} n])

Arguments

{number[]} n optional

Array representing the 2x2 column-major ordered compoents Array of length !== 4 will return the identity matrix

Returns

{Matrix2}

#n00203-205

row 0, col0, Matrix2#n[0]

Signature

{number} Matrix2#n00

#n01216-218

row 0, col1, Matrix2#n[2]

Signature

{number} Matrix2#n01

#n10229-231

row 1, col0, Matrix2#n[1]

Signature

{number} Matrix2#n10

#n11242-244

row 1, col1, Matrix2#n[3]

Signature

{number} Matrix2#n11

#determinant255-257

The determinant

Signature

{number} Matrix2#determinant

#add(a, b)266-272

The sum of a and b (a+b)

Signature

{Matrix2} Matrix2#add({Matrix2} a, {Matrix2} b)

Arguments

{Matrix2} a

The first summand

{Matrix2} b

The second summand

Returns

{Matrix2}

#subtract(a, b)280-286

The difference of a and b (a-b)

Signature

{Matrix2} Matrix2#subtract({Matrix2} a, {Matrix2} b)

Arguments

{Matrix2} a

The minuend

{Matrix2} b

The subtrahend

Returns

{Matrix2}

#multiply(a, b)294-310

The concatenation of a and b (a*b)

Signature

{Matrix2} Matrix2#multiply({Matrix2} a, {Matrix2} b)

Arguments

{Matrix2} a

The first transform

{Matrix2} b

The second transform

Returns

{Matrix2}

#inverseOf(m)320-336

The inverse of m Beware: method is NOT chainable Returns false if m is assumed to be singular, true otherwise

Signature

{Boolean} Matrix2#inverseOf({Matrix2} m)

Arguments

{Matrix2} m

The source

Returns

{Boolean}

#transposeOf(m)343-350

The transpose of m

Signature

{Matrix2} Matrix2#transposeOf({Matrix2} m)

Arguments

{Matrix2} m

The source

Returns

{Matrix2}

#copyOf(m)357-361

The copy of m

Signature

{Matrix2} Matrix2#copyOf({Matrix2} m)

Arguments

{Matrix2} m

The source

Returns

{Matrix2}

#invert()369-371

The inverse of the instance Returns false if the instance is assumed to singular, true otherwise

Signature

{boolean} Matrix2#invert()

Arguments

None

Returns

{boolean}

#transpose()377-379

The transpose of the instance

Signature

{Matrix2} Matrix2#transpose()

Arguments

None

Returns

{Matrix2}

#toString(digits)387-393

Returns a string representation of the instance

Signature

{string} Matrix2#toString([{int} digits=3])

Arguments

{int} digits optionaldefault3

The decimal digits

Returns

{string}

#valueOf()399-401

Returns the Matrix2#determinant of the instance

Signature

{number} Matrix2#valueOf()

Arguments

None

Returns

{number}

/source/Matrix3.js:Matrix39-979

2x3 and 3x3 transformations

Import

import { Matrix3 } from 'xyzw/source/Matrix3.js'

.Rotation(axis, rad, target)18-35

Returns a instance of axis and rotation

Signature

{Matrix3} Matrix3.Rotation({Vector3} axis, {number} rad [, {Matrix3} target])

Arguments

{Vector3} axis

The rotation axis

{number} rad

The rotation in radians

{Matrix3} target optional

The target instance

Returns

{Matrix3}

.RotationX(rad, target)43-57

Returns a instance of x-axis rotation

Signature

{Matrix3} Matrix3.RotationX({number} rad [, {Matrix3} target])

Arguments

{number} rad

The rotation in radians

{Matrix3} target optional

The target instance

Returns

{Matrix3}

.RotationY(rad, target)65-79

Returns a instance of y-axis rotation

Signature

{Matrix3} Matrix3.RotationY({number} rad [, {Matrix3} target])

Arguments

{number} rad

The rotation in radians

{Matrix3} target optional

The target instance

Returns

{Matrix3}

.RotationZ(rad, target)87-101

Returns a instance of z-axis rotation

Signature

{Matrix3} Matrix3.RotationZ({number} rad [, {Matrix3} target])

Arguments

{number} rad

The rotation in radians

{Matrix3} target optional

The target instance

Returns

{Matrix3}

.EulerXYZ(x, y, z, target)112-135

Returns a instance of (x,y,z) ordered euler angles

Signature

{Matrix3} Matrix3.EulerXYZ({number} x, {number} y, {number} z [, {Matrix3} target])

Arguments

{number} x

The first (x-axis) rotation in radians

{number} y

The second (y-axis) rotation in radians

{number} z

The third (z-axis) rotation in radians

{Matrix3} target optional

The target instance

Returns

{Matrix3}

.EulerYXZ(x, y, z, target)146-169

Returns a instance of (y,x,z) ordered euler angles

Signature

{Matrix3} Matrix3.EulerYXZ({number} x, {number} y, {number} z [, {Matrix3} target])

Arguments

{number} x

The second (x-axis) rotation in radians

{number} y

The first (y-axis) rotation in radians

{number} z

The third (z-axis) rotation in radians

{Matrix3} target optional

The target instance

Returns

{Matrix3}

.EulerZXY(x, y, z, target)179-202

Returns a instance of (z,x,y) ordered euler angles

Signature

{Matrix3} Matrix3.EulerZXY({number} x, {number} y, {number} z [, {Matrix3} target])

Arguments

{number} x

The second (x-axis) rotation in radians

{number} y

The third (y-axis) rotation in radians

{number} z

The first (z-axis) rotation in radians

{Matrix3} target optional

The target instance

Returns

{Matrix3}

.Scale(v, target)211-224

Returns a instance of scale vector

Signature

{Matrix3} Matrix3.Scale({Vector3} v [, {Matrix3} target])

Arguments

{Vector3} v

The source

{Matrix3} target optional

The target instance

Returns

{Matrix3}

.Translation(v, target)232-245

Returns a instance of translation vector

Signature

{Matrix3} Matrix3.Translation({Vector2} v [, {Matrix3} target])

Arguments

{Vector2} v

The source

{Matrix3} target optional

The target instance

Returns

{Matrix3}

.Vector2(x, y, t, target)255-269

Returns an instance created from axes (x, y) and translation t

Signature

{Matrix3} Matrix3.Vector2({Vector2} x [, {Vector2} y [, {Vector2} t [, {Matrix3} target]]])

Arguments

{Vector2} x

The x axis

{Vector2} y optional

The y axis

{Vector2} t optional

The translation

{Matrix3} target optional

the target instance

Returns

{Matrix3}

.Vector3(x, y, z, target)279-287

Returns a instance of axes (x, y, z)

Signature

{Matrix3} Matrix3.Vector3({Vector3} x, {Vector3} y [, {Vector3} z [, {Matrix3} target]])

Arguments

{Vector3} x

The x-axis vector

{Vector3} y

The y-axis vector

{Vector3} z optional

The z-axis vector

{Matrix3} target optional

The target instance

Returns

{Matrix3}

.Vector4(q, target)295-314

Returns a instance of unit-quaternion q

Signature

{Matrix3} Matrix3.Vector4({Vector4} q [, {Matrix3} target])

Arguments

{Vector4} q

The source

{Matrix3} target optional

The target instance

Returns

{Matrix3}

.Matrix2(m, target)324-333

Returns a instance of m The instance will be padded to 3x3

Signature

{Matrix3} Matrix3.Matrix2({Matrix2} m [, {Matrix3} target])

Arguments

{Matrix2} m

The source

{Matrix3} target optional

The target instance

Returns

{Matrix3}

.Matrix4(m, target)342-352

Returns a instance of m The instance will be cropped to 3x3 by removing the fourth row & column of m

Signature

{Matrix3} Matrix3.Matrix4({Matrix4} m [, {Matrix3} target])

Arguments

{Matrix4} m

The source

{Matrix3} target optional

The target instance

Returns

{Matrix3}

.Add(a, b, target)362-364

Returns the sum of a and b (a+b)

Signature

{Matrix3} Matrix3.Add({Matrix3} a, {Matrix3} b [, {Matrix3} target])

Arguments

{Matrix3} a

The first summand

{Matrix3} b

The second summand

{Matrix3} target optional

The target instance

Returns

{Matrix3}

.Subtract(a, b, target)373-375

Returns the difference of a and b (a-b)

Signature

{Matrix3} Matrix3.Subtract({Matrix3} a, {Matrix3} b [, {Matrix3} target])

Arguments

{Matrix3} a

The minuend

{Matrix3} b

The subtrahend

{Matrix3} target optional

The target instance

Returns

{Matrix3}

.Multiply2x3Vector2Scale(m, v, target)385-387

Returns the 2x3 concatenation of m and matrix-transformed v (m*Matrix3.Matrix2(Matrix2.Scale(v))) Components 2x are assumed to be (0.0,0.0,1.0)

Signature

{Matrix3} Matrix3.Multiply2x3Vector2Scale({Matrix3} m, {Vector2} v [, {Matrix3} target])

Arguments

{Matrix3} m

The matrix

{Vector2} v

The vector

{Matrix3} target optional

The target instance

Returns

{Matrix3}

.Multiply2x3Vector2Translation(m, v, target)396-398

Returns the 2x3 concatenation of m and matrix-transformed v (m*Matrix3.Translation(v))

Signature

{Matrix3} Matrix3.Multiply2x3Vector2Translation({Matrix3} m, {Vector2} v [, {Matrix3} target])

Arguments

{Matrix3} m

The matrix

{Vector2} v

The vector

{Matrix3} target optional

The target instance

Returns

{Matrix3}

.Multiply2x3Matrix2(a, b, target)408-410

Returns the 2x3 concatenation of a and b (a*b) Components 2x are assumed to be (0.0,0.0,1.0)

Signature

{Matrix3} Matrix3.Multiply2x3Matrix2({Matrix3} a, {Matrix2} b [, {Matrix3} target])

Arguments

{Matrix3} a

The first transform

{Matrix2} b

The second transform

{Matrix3} target optional

The target instance

Returns

{Matrix3}

.Multiply2x3(a, b, target)420-422

Returns the 2x3 concatenation of a and b (a*b) Components 2x are assumed to be (0.0,0.0,1.0)

Signature

{Matrix3} Matrix3.Multiply2x3({Matrix3} a, {Matrix3} b [, {Matrix3} target])

Arguments

{Matrix3} a

The first transform

{Matrix3} b

The second transform

{Matrix3} target optional

The target instance

Returns

{Matrix3}

.Multiply(a, b, target)431-433

Returns the concatenation of a and b (a*b)

Signature

{Matrix3} Matrix3.Multiply({Matrix3} a, {Matrix3} b [, {Matrix3} target])

Arguments

{Matrix3} a

The first transform

{Matrix3} b

The second transform

{Matrix3} target optional

The target instance

Returns

{Matrix3}

.Inverse(m, target)443-447

Returns the inverse of m Returns null if m is assumed to be singular, the inverse of m otherwise

Signature

{Matrix3|null} Matrix3.Inverse({Matrix3} m [, {Matrix3} target])

Arguments

{Matrix3} m

The source

{Matrix3} target optional

The target instance

Returns

{Matrix3|null}

.Transpose(m, target)455-457

Returns the transpose of m

Signature

{Matrix3} Matrix3.Transpose({Matrix3} m [, {Matrix3} target])

Arguments

{Matrix3} m

The source

{Matrix3} target optional

The target instance

Returns

{Matrix3}

.Copy(m, target)465-467

Returns a copy of m

Signature

{Matrix3} Matrix3.Copy({Matrix3} m [, {Matrix3} target])

Arguments

{Matrix3} m

The source

{Matrix3} target optional

The target instance

Returns

{Matrix3}

.isEQ(a, b)476-486

Returns true if a and b are equal, false otherwise

Signature

{boolean} Matrix3.isEQ({Matrix3} a, {Matrix3} b)

Arguments

{Matrix3} a

The protagonist

{Matrix3} b

The antagonist

Returns

{boolean}

#constructor(n)495-505

Creates a new instance

Signature

{undefined} Matrix3#constructor([{number[]} n])

Arguments

{number[]} n optional

Array represeting 3x3 column-major ordered components Arrays of length !== 9 will return the identity matrix

Returns

No return value

#n504-504

The array representation Contains the 9 column-major ordered components of the instance n[0]:n00 n[3]:n01 n[6]:n02 n[1]:n10 n[4]:n11 n[7]:n12 n[2]:n20 n[5]:n21 n[8]:n22

Signature

{number[]} Matrix3#n

#define(n)514-518

Redefines the instance

Signature

{Matrix3} Matrix3#define([{number[]} n])

Arguments

{number[]} n optional

Array representing 3x3 column-major ordered components Arrays of length !== 9 will return the identity matrix.

Returns

{Matrix3}

#n00525-527

row 0, col 0, Matrix3#n[0]

Signature

{number} Matrix3#n00

#n01538-540

row 0, col 1, Matrix3#n[3]

Signature

{number} Matrix3#n01

#n02551-553

row 0, col 2, Matrix3#n[6]

Signature

{number} Matrix3#n02

#n10564-566

row 1, col 0, Matrix3#n[1]

Signature

{number} Matrix3#n10

#n11577-579

row 1, col 1, Matrix3#n[4]

Signature

{number} Matrix3#n11

#n12590-592

row 1, col 2, Matrix3#n[7]

Signature

{number} Matrix3#n12

#n20603-605

row 2, col 0, Matrix3#n[2]

Signature

{number} Matrix3#n20

#n21616-618

row 2, col 1, Matrix3#n[5]

Signature

{number} Matrix3#n21

#n22629-631

row 2, col 2, Matrix3#n[8]

Signature

{number} Matrix3#n22

#determinant642-649

The determinant

Signature

{number} Matrix3#determinant

#add(a, b)658-664

The sum of a and b (a+b)

Signature

{Matrix3} Matrix3#add({Matrix3} a, {Matrix3} b)

Arguments

{Matrix3} a

The first summand

{Matrix3} b

The second summand

Returns

{Matrix3}

#subtract(a, b)672-678

The difference of a and b (a-b)

Signature

{Matrix3} Matrix3#subtract({Matrix3} a, {Matrix3} b)

Arguments

{Matrix3} a

The minuend

{Matrix3} b

The subtrahend

Returns

{Matrix3}

#multiply2x3Vector2Scale(m, v)687-697

The 2x3 concatenation of m and matrix-transformed v (m*Matrix3.Matrix2(Matrix2.Scale(v))) Components 2x are assumed to be (0.0,0.0,1.0)

Signature

{Matrix3} Matrix3#multiply2x3Vector2Scale({Matrix3} m, {Vector2} v)

Arguments

{Matrix3} m

The matrix

{Vector2} v

The vector

Returns

{Matrix3}

#multiply2x3Vector2Translation(m, v)706-720

The 2x3 concatenation of m and matrix-transformed v (m*Matrix3.Translation(v)) Components 2x are assumed to be (0.0,0.0,1.0)

Signature

{Matrix3} Matrix3#multiply2x3Vector2Translation({Matrix3} m, {Vector2} v)

Arguments

{Matrix3} m

The matrix

{Vector2} v

The vector

Returns

{Matrix3}

#multiply2x3Matrix2(a, b)729-747

The 2x3 concatenation of a and b (a*b) Components 2x are assumed to be (0.0,0.0,1.0)

Signature

{Matrix3} Matrix3#multiply2x3Matrix2({Matrix3} a, {Matrix2} b)

Arguments

{Matrix3} a

The first transform

{Matrix2} b

The second transform

Returns

{Matrix3}

#multiply2x3(a, b)756-777

The 2x3 concatenation of a and b (a*b) Components 2x are assumed to be (0.0,0.0,1.0)

Signature

{Matrix3} Matrix3#multiply2x3({Matrix3} a, {Matrix3} b)

Arguments

{Matrix3} a

The first transform

{Matrix3} b

The second transform

Returns

{Matrix3}

#multiply(a, b)785-809

The concatenation of a and b (a*b)

Signature

{Matrix3} Matrix3#multiply({Matrix3} a, {Matrix3} b)

Arguments

{Matrix3} a

The first transform

{Matrix3} b

The second transform

Returns

{Matrix3}

#inverseOf(m)819-843

The inverse of m Beware: method is NOT chainable

Signature

{Boolean} Matrix3#inverseOf({Matrix3} m)

Arguments

{Matrix3} m

The source

Returns

{Boolean}

Returns false if m is assumed to be singular, true otherwise

#transposeOf(m)850-858

The transpose of m

Signature

{Matrix3} Matrix3#transposeOf({Matrix3} m)

Arguments

{Matrix3} m

The source

Returns

{Matrix3}

#copyOf(m)865-869

The copy of m

Signature

{Matrix3} Matrix3#copyOf({Matrix3} m)

Arguments

{Matrix3} m

The source

Returns

{Matrix3}

#invert()878-880

The inverse of the instance Beware: method is NOT chainable

Signature

{Boolean} Matrix3#invert()

Arguments

None

Returns

{Boolean}

Returns false if the instance is assumed to be singular, true otherwise

#transpose()886-888

The transpose of the instance

Signature

{Matrix3} Matrix3#transpose()

Arguments

None

Returns

{Matrix3}

#toEulerYXZ()895-909

Returns a (x,y,z) ordered (y,x,z) euler angle representation of the instance

Signature

{number[]} Matrix3#toEulerYXZ()

Arguments

None

Returns

{number[]}

#toEulerZXY()915-929

Returns a (x,y,z) ordered (z,x,y) euler angle representation of the instance

Signature

{number[]} Matrix3#toEulerZXY()

Arguments

None

Returns

{number[]}

#toCSS2x3(digits)937-944

Returns a css-formated 2x3 string representation of the instance Components 2x are assumed to be (0.0,0.0,1.0)

Signature

{String} Matrix3#toCSS2x3([{int} digits=3])

Arguments

{int} digits optionaldefault3

The decimal digits

Returns

{String}

#toCSS(digits)951-957

Returns a css-formated 3x3 string representation of the instance

Signature

{String} Matrix3#toCSS([{int} digits=3])

Arguments

{int} digits optionaldefault3

The decimal digits

Returns

{String}

#toString(digits)964-970

Returns a string representation of the instance

Signature

{String} Matrix3#toString([{int} digits=3])

Arguments

{int} digits optionaldefault3

The decimal digits

Returns

{String}

#valueOf()976-978

Returns the Matrix3#determinant of the instance

Signature

{number} Matrix3#valueOf()

Arguments

None

Returns

{number}

/source/Matrix4.js:Matrix49-936

3x4 and 4x4 transformations

Import

import { Matrix4 } from 'xyzw/source/Matrix4.js'

.Translation(v, target)17-31

Returns a instance of translation vector

Signature

{Matrix4} Matrix4.Translation({Vector3} v [, {Matrix4} target])

Arguments

{Vector3} v

The source

{Matrix4} target optional

The target instance

Returns

{Matrix4}

.Vector3(x, y, z, t, target)42-52

Returns a instance of axes (x,y,z) and translation (t)

Signature

{Matrix4} Matrix4.Vector3({Vector3} x, {Vector3} y [, {Vector3} z [, {Vector3} t [, {Matrix4} target]]])

Arguments

{Vector3} x

The x-axis vector

{Vector3} y

The y-axis vector

{Vector3} z optional

The z-axis vector

{Vector3} t optional

The translation vector

{Matrix4} target optional

The target instance

Returns

{Matrix4}

.Matrix3(m, target)61-71

Returns a instance of m The instance will be padded to 4x4

Signature

{Matrix4} Matrix4.Matrix3({Matrix3} m [, {Matrix4} target])

Arguments

{Matrix3} m

The source

{Matrix4} target optional

The target instance

Returns

{Matrix4}

.Add(a, b, target)81-83

Returns the sum of a and b (a+b)

Signature

{Matrix4} Matrix4.Add({Matrix4} a, {Matrix4} b [, {Matrix4} target])

Arguments

{Matrix4} a

The first summand

{Matrix4} b

The second summand

{Matrix4} target optional

The target instance

Returns

{Matrix4}

.Subtract(a, b, target)92-94

Returns the difference of a and b (a-b)

Signature

{Matrix4} Matrix4.Subtract({Matrix4} a, {Matrix4} b [, {Matrix4} target])

Arguments

{Matrix4} a

The minuend

{Matrix4} b

The subtrahend

{Matrix4} target optional

The target instance

Returns

{Matrix4}

.Multiply3x4Vector3Scale(m, v, target)104-106

Returns the 3x4 concatenation of m and matrix-transformed v (m*Matrix4.Matrix3(Matrix3.Scale(v))) Components 3x are assumed to be (0.0,0.0,0.0,1.0)

Signature

{Matrix4} Matrix4.Multiply3x4Vector3Scale({Matrix4} m, {Vector3} v [, {Matrix4} target])

Arguments

{Matrix4} m

The matrix

{Vector3} v

The vector

{Matrix4} target optional

The target instance

Returns

{Matrix4}

.Multiply3x4Vector3Translation(m, v, target)116-118

Returns the 3x4 concatenation of m and matrix-transformed v (m*Matrix4.Translation(v)) Components 3x are assumed to be (0.0,0.0,0.0,1.0)

Signature

{Matrix4} Matrix4.Multiply3x4Vector3Translation({Matrix4} m, {Vector3} v [, {Matrix4} target])

Arguments

{Matrix4} m

The matrix

{Vector3} v

The vector

{Matrix4} target optional

The target instance

Returns

{Matrix4}

.Multiply3x4Matrix3(a, b, target)128-130

Returns the 3x4 concatenation of a and b (a*b) Components 3x are assumed to be (0.0,0.0,0.0,1.0)

Signature

{Matrix4} Matrix4.Multiply3x4Matrix3({Matrix4} a, {Matrix3} b [, {Matrix4} target])

Arguments

{Matrix4} a

The first matrix

{Matrix3} b

The second matrix

{Matrix4} target optional

The target instance

Returns

{Matrix4}

.Multiply3x4(a, b, target)140-142

Returns the 3x4 concatenation of a and b (a*b) Components 3x are assumed to be (0.0,0.0,0.0,1.0)

Signature

{Matrix4} Matrix4.Multiply3x4({Matrix4} a, {Matrix4} b [, {Matrix4} target])

Arguments

{Matrix4} a

The first matrix

{Matrix4} b

The second matrix

{Matrix4} target optional

The target instance

Returns

{Matrix4}

.Multiply(a, b, target)151-153

Returns the concatenation of a and b (a*b)

Signature

{Matrix4} Matrix4.Multiply({Matrix4} a, {Matrix4} b [, {Matrix4} target])

Arguments

{Matrix4} a

The first matrix

{Matrix4} b

The second matrix

{Matrix4} target optional

The target instance

Returns

{Matrix4}

.Inverse3x4(m, target)164-168

Returns the 3x4 inverse of m Components 3x are to be (0.0,0.0,0.0,1.0) Returns null if m is assumed to be singular, the 3x4 inverse of m otherwise

Signature

{Matrix4|null} Matrix4.Inverse3x4({Matrix4} m [, {Matrix4} target])

Arguments

{Matrix4} m

The source

{Matrix4} target optional

The target instance

Returns

{Matrix4|null}

.Inverse(m, target)178-182

Returns the inverse of m Using the adjoint method Returns null if m is assumed to be singular, the 4x4 inverse of m otherwise

Signature

{Matrix4|null} Matrix4.Inverse({Matrix4} m [, {Matrix4} target])

Arguments

{Matrix4} m

The source

{Matrix4} target optional

The target instance

Returns

{Matrix4|null}

.InverseGauss(m, target)192-196

Returns the inverse of m Using gauss-jordan elimination Returns null if m is singular, the 4x4 inverse of m otherwise

Signature

{Matrix4|null} Matrix4.InverseGauss({Matrix4} m [, {Matrix4} target])

Arguments

{Matrix4} m

The source

{Matrix4} target optional

The target instance

Returns

{Matrix4|null}

.Transpose(m, target)204-206

Returns the transpose of m

Signature

{Matrix4} Matrix4.Transpose({Matrix4} m [, {Matrix4} target])

Arguments

{Matrix4} m

The source

{Matrix4} target optional

The target instance

Returns

{Matrix4}

.Copy(m, target)214-216

Returns a copy of m

Signature

{Matrix4} Matrix4.Copy({Matrix4} m [, {Matrix4} target])

Arguments

{Matrix4} m

The source

{Matrix4} target optional

The target instance

Returns

{Matrix4}

.isEQ(a, b)225-235

Returns true if a and b are equal, false otherwise (a == b)

Signature

{Boolean} Matrix4.isEQ({Matrix4} a, {Matrix4} b)

Arguments

{Matrix4} a

The protagonist

{Matrix4} b

The antagonist

Returns

{Boolean}

.inverseGaussOf(m)781-844

The inverse of m Beware: method is NOT chainable Using gauss-jordan elimination returns false if m is singular, false otherwise

Signature

{Boolean} Matrix4.inverseGaussOf({Matrix4} m)

Arguments

{Matrix4} m

The source

Returns

{Boolean}

#constructor(n)244-255

Creates a new instance

Signature

{undefined} Matrix4#constructor([{number[]} n])

Arguments

{number[]} n optional

Array representing 4x4 column-major ordered components Arrays of length !== 16 will return the identity matrix

Returns

No return value

#n254-254

The array representation Contains the 16 column-major ordered components of the instance n[0]:n00 n[4]:n01 n[8] :n02 n[12]:n03 n[1]:n10 n[5]:n11 n[9] :n12 n[13]:n13 n[2]:n20 n[6]:n21 n[10]:n22 n[14]:n23 n[3]:n30 n[7]:n31 n[11]:n32 n[15]:n33

Signature

{number[]} Matrix4#n

#define(n)264-268

Redefines the instance

Signature

{Matrix4} Matrix4#define([{number[]} n])

Arguments

{number[]} n optional

Array representing 4x4 column-major ordered components Arrays of length !== 16 will return the identity matrix

Returns

{Matrix4}

#n00275-277

row 0, col 0, Matrix4#n[0]

Signature

{number} Matrix4#n00

#n01288-290

row 0, col 1, Matrix4#n[4]

Signature

{number} Matrix4#n01

#n02301-303

row 0, col 2, Matrix4#n[8]

Signature

{number} Matrix4#n02

#n03314-316

row 0, col 3, Matrix4#n[12]

Signature

{number} Matrix4#n03

#n10327-329

row 1, col 0, Matrix4#n[1]

Signature

{number} Matrix4#n10

#n11340-342

row 1, col 1, Matrix4#n[5]

Signature

{number} Matrix4#n11

#n12353-355

row 1, col 2, Matrix4#n[9]

Signature

{number} Matrix4#n12

#n13366-368

row 1, col 3, Matrix4#n[13]

Signature

{number} Matrix4#n13

#n20379-381

row 2, col 0, Matrix4#n[2]

Signature

{number} Matrix4#n20

#n21392-394

row 2, col 1, Matrix4#n[6]

Signature

{number} Matrix4#n21

#n22405-407

row 2, col 2, Matrix4#n[10]

Signature

{number} Matrix4#n22

#n23418-420

row 2, col 3, Matrix4#n[14]

Signature

{number} Matrix4#n23

#n30431-433

row 3, col 0, Matrix4#n[3]

Signature

{number} Matrix4#n30

#n31444-446

row 3, col 1, Matrix4#n[7]

Signature

{number} Matrix4#n31

#n32457-459

row 3, col 2, Matrix4#n[11]

Signature

{number} Matrix4#n32

#n33470-472

row 3, col 3, Matrix4#n[15]

Signature

{number} Matrix4#n33

#determinant483-490

The determinant

Signature

{number} Matrix4#determinant

#add(a, b)499-505

The sum of a and b (a+b)

Signature

{Matrix4} Matrix4#add({Matrix4} a, {Matrix4} b)

Arguments

{Matrix4} a

The first summand

{Matrix4} b

The second summand

Returns

{Matrix4}

#subtract(a, b)513-519

The difference of a and b (a-b)

Signature

{Matrix4} Matrix4#subtract({Matrix4} a, {Matrix4} b)

Arguments

{Matrix4} a

The minuend

{Matrix4} b

The subtrahend

Returns

{Matrix4}

#multiply3x4Vector3Scale(m, v)528-539

The 3x4 concatenation of m and matrix-transformed v (m*Matrix4.Matrix3(Matrix3.Scale(v))) Components 3x are assumed to be (0.0,0.0,0.0,1.0)

Signature

{Matrix4} Matrix4#multiply3x4Vector3Scale({Matrix4} m, {Vector3} v)

Arguments

{Matrix4} m

The matrix

{Vector3} v

The vector

Returns

{Matrix4}

#multiply3x4Vector3Translation(m, v)548-558

The 3x4 concatenation of m and matrix-transformed v (m*Matrix4.Translation(v)) Components 3x are assumed to be (0.0,0.0,0.0,1.0)

Signature

{Matrix4} Matrix4#multiply3x4Vector3Translation({Matrix4} m, {Vector3} v)

Arguments

{Matrix4} m

The matrix

{Vector3} v

The vector

Returns

{Matrix4}

#multiply3x4Matrix3(a, b)567-597

The 3x4 concatenation of a and b (a*b) Components 3x are assumed to be (0.0,0.0,0.0,1.0)

Signature

{Matrix4} Matrix4#multiply3x4Matrix3({Matrix4} a, {Matrix3} b)

Arguments

{Matrix4} a

The first matrix

{Matrix3} b

The second matrix

Returns

{Matrix4}

#multiply3x4(a, b)606-636

The 3x4 concatenation of a and b (a*b) Components 3x are assumed to be (0.0,0.0,0.0,1.0)

Signature

{Matrix4} Matrix4#multiply3x4({Matrix4} a, {Matrix4} b)

Arguments

{Matrix4} a

The first transform

{Matrix4} b

The second transform

Returns

{Matrix4}

#multiply(a, b)644-678

The concatenation of a and b (a*b)

Signature

{Matrix4} Matrix4#multiply({Matrix4} a, {Matrix4} b)

Arguments

{Matrix4} a

The first transform

{Matrix4} b

The second transform

Returns

{Matrix4}

#inverse3x4Of(m)689-719

The 3x4 inverse of m Beware: method is NOT chainable Components 3x are assumed to be (0.0,0.0,0.0,1.0) Returns false if m is assumed to be singular, true otherwise

Signature

{Boolean} Matrix4#inverse3x4Of({Matrix4} m)

Arguments

{Matrix4} m

The 3x4 source

Returns

{Boolean}

#inverseOf(m)729-771

The inverse of m Beware: method is NOT chainable. Using the adjoint method - m[ij] = 1 / d (-1)^(i + j) det(adj(m[ji])) Returns false if m is assumed to be singular, true otherwise

Signature

{Boolean} Matrix4#inverseOf({Matrix4} m)

Arguments

{Matrix4} m

The source

Returns

{Boolean}

#transposeOf(m)851-860

The transpose of m

Signature

{Matrix4} Matrix4#transposeOf({Matrix4} m)

Arguments

{Matrix4} m

The source

Returns

{Matrix4}

#copyOf(m)867-871

The copy of m

Signature

{Matrix4} Matrix4#copyOf({Matrix4} m)

Arguments

{Matrix4} m

The source

Returns

{Matrix4}

#invert3x4()881-883

The 3x4 inverse of the instance Beware: method is NOT chainable Components 3x are assumed to be (0.0,0.0,0.0,1.0)

Signature

{boolean} Matrix4#invert3x4()

Arguments

None

Returns

{boolean}

Returns false if the instance is assumed to be singular, true otherwise

#invert()892-894

The inverse of the instance Beware: method is NOT chainable Using the adjoint method

Signature

{boolean} Matrix4#invert()

Arguments

None

Returns

{boolean}

Returns false if the instance is assumed to be singular, true otherwise

#invertGauss()903-905

The inverse of the instance Beware: method is NOT chainable using gauss-jordan elimination

Signature

{boolean} Matrix4#invertGauss()

Arguments

None

Returns

{boolean}

Returns false if the instance is singular, true otherwise

#transpose()911-913

The transpose of the instance

Signature

{Matrix4} Matrix4#transpose()

Arguments

None

Returns

{Matrix4}

#toString(digits)921-927

Returns a string representation of the instance

Signature

{string} Matrix4#toString([{int} digits=3])

Arguments

{int} digits optionaldefault3

The number of digits

Returns

{string}

#valueOf()933-935

Returns the Matrix4#determinant of the instance

Signature

{number} Matrix4#valueOf()

Arguments

None

Returns

{number}

/source/Matrix4Frustrum.js:FOV_MIN10-10

The minimal vertical field of view

Import

import { FOV_MIN } from 'xyzw/source/Matrix4Frustrum.js'

/source/Matrix4Frustrum.js:FOV_MAX15-15

The maximal vertical field of view

Import

import { FOV_MAX } from 'xyzw/source/Matrix4Frustrum.js'

/source/Matrix4Frustrum.js:FOV_DEFAULT20-20

The default vertical field of view

Import

import { FOV_DEFAULT } from 'xyzw/source/Matrix4Frustrum.js'

/source/Matrix4Frustrum.js:ASPECT_MIN25-25

The minimal projection aspect ratio (w/h)

Import

import { ASPECT_MIN } from 'xyzw/source/Matrix4Frustrum.js'

/source/Matrix4Ortho.js:ASPECT_MIN25-25

The minimal projection aspect ratio (w/h)

Import

import { ASPECT_MIN } from 'xyzw/source/Matrix4Ortho.js'

/source/Matrix4Frustrum.js:ASPECT_MAX30-30

The maximal projection aspect ratio (w/h)

Import

import { ASPECT_MAX } from 'xyzw/source/Matrix4Frustrum.js'

/source/Matrix4Ortho.js:ASPECT_MAX30-30

The maximal projection aspect ratio (w/h)

Import

import { ASPECT_MAX } from 'xyzw/source/Matrix4Ortho.js'

/source/Matrix4Frustrum.js:ASPECT_DEFAULT35-35

The default projection aspect ratio (w/h)

Import

import { ASPECT_DEFAULT } from 'xyzw/source/Matrix4Frustrum.js'

/source/Matrix4Ortho.js:ASPECT_DEFAULT35-35

The default projection aspect ratio (w/h)

Import

import { ASPECT_DEFAULT } from 'xyzw/source/Matrix4Ortho.js'

/source/Matrix4Frustrum.js:ZPLANE_MIN40-40

The minimal z-plane distance

Import

import { ZPLANE_MIN } from 'xyzw/source/Matrix4Frustrum.js'

/source/Matrix4Ortho.js:ZPLANE_MIN40-40

The minimal z-plane distance

Import

import { ZPLANE_MIN } from 'xyzw/source/Matrix4Ortho.js'

/source/Matrix4Frustrum.js:ZPLANE_MAX45-45

The maximal z-plane distance

Import

import { ZPLANE_MAX } from 'xyzw/source/Matrix4Frustrum.js'

/source/Matrix4Ortho.js:ZPLANE_MAX45-45

The maximal z-plane distance

Import

import { ZPLANE_MAX } from 'xyzw/source/Matrix4Ortho.js'

/source/Matrix4Frustrum.js:Matrix4Frustrum augments Matrix459-199

Perspectivic projection matrix

Import

import { Matrix4Frustrum } from 'xyzw/source/Matrix4Frustrum.js'

.Copy(m, target)67-70

Returns a copy of m

Signature

{Matrix4Frustrum} Matrix4Frustrum.Copy({Matrix4Frustrum} m [, {Matrix4Frustrum} target])

Arguments

{Matrix4Frustrum} m

The source

{Matrix4Frustrum} target optional

The target instance

Returns

{Matrix4Frustrum}

#constructor(fov, aspect, near, far)81-90

Creates a new instance

Signature

{undefined} Matrix4Frustrum#constructor([{number} fov=FOV_DEFAULT [, {number} aspect=ASPECT_DEFAULT [, {number} near=ZPLANE_MIN [, {number} far=ZPLANE_MAX]]]])

Arguments

{number} fov optionaldefaultFOV_DEFAULT

The vertical field of view, in radians

{number} aspect optionaldefaultASPECT_DEFAULT

The aspect ratio (w/h)

{number} near optionaldefaultZPLANE_MIN

The distance of the near plane

{number} far optionaldefaultZPLANE_MAX

The distance of the far plane

Returns

No return value

#define(fov, aspect, near, far)101-148

(Re)defines the instance

Signature

{Matrix4Frustrum} Matrix4Frustrum#define([{number} fov=FOV_DEFAULT [, {number} aspect=ASPECT_DEFAULT [, {number} near=ZPLANE_MIN [, {number} far=ZPLANE_MAX]]]])

Arguments

{number} fov optionaldefaultFOV_DEFAULT

The vertical field of view, in radians

{number} aspect optionaldefaultASPECT_DEFAULT

The aspect ratio (w/h)

{number} near optionaldefaultZPLANE_MIN

The near plane distance

{number} far optionaldefaultZPLANE_MAX

The far plane distance

Returns

{Matrix4Frustrum}

#fov155-157

The vertical field of view, in radians

Signature

{number} Matrix4Frustrum#fov

#aspect163-165

The projection aspect ratio (w/h)

Signature

{number} Matrix4Frustrum#aspect

#near171-173

The distance of the near plane

Signature

{number} Matrix4Frustrum#near

#far179-181

The distance of the far plane

Signature

{number} Matrix4Frustrum#far

#copyOf(m)189-198

The copy of m

Signature

{Matrix4Frustrum} Matrix4Frustrum#copyOf({Matrix4Frustrum} m)

Arguments

{Matrix4Frustrum} m

The source

Returns

{Matrix4Frustrum}

/source/Matrix4Ortho.js:EXTEND_MIN10-10

The minimal vertical extend of the viewcube

Import

import { EXTEND_MIN } from 'xyzw/source/Matrix4Ortho.js'

/source/Matrix4Ortho.js:EXTEND_MAX15-15

The maximal vertical extend of the viewcube

Import

import { EXTEND_MAX } from 'xyzw/source/Matrix4Ortho.js'

/source/Matrix4Ortho.js:EXTEND_DEFAULT20-20

The default vertical extend of the viewcube

Import

import { EXTEND_DEFAULT } from 'xyzw/source/Matrix4Ortho.js'

/source/Matrix4Ortho.js:Matrix4Ortho augments Matrix459-197

Orthographic projection Matrix

Import

import { Matrix4Ortho } from 'xyzw/source/Matrix4Ortho.js'

.Copy(m, target)67-70

Returns a copy of m

Signature

{Matrix4Ortho} Matrix4Ortho.Copy({Matrix4Ortho} m [, {Matrix4Ortho} target])

Arguments

{Matrix4Ortho} m

The source

{Matrix4Ortho} target optional

The target instance

Returns

{Matrix4Ortho}

#constructor(extend, aspect, near, far)81-90

Creates a new instance

Signature

{undefined} Matrix4Ortho#constructor([{number} extend=EXTEND_DEFAULT [, {number} aspect=ASPECT_DEFAULT [, {number} near=ZPLANE_MIN [, {number} far=ZPLANE_MAX]]]])

Arguments

{number} extend optionaldefaultEXTEND_DEFAULT

The vertical extend of the viewcube

{number} aspect optionaldefaultASPECT_DEFAULT

The aspect ratio (w/h)

{number} near optionaldefaultZPLANE_MIN

The near plane distance

{number} far optionaldefaultZPLANE_MAX

The far plane distance

Returns

No return value

#define(extend, aspect, near, far)101-146

(Re)defines the instance

Signature

{Matrix4Ortho} Matrix4Ortho#define([{number} extend=EXTEND_DEFAULT [, {number} aspect=ASPECT_DEFAULT [, {number} near=ZPLANE_MIN [, {number} far=ZPLANE_MAX]]]])

Arguments

{number} extend optionaldefaultEXTEND_DEFAULT

The vertical extend of the viewcube

{number} aspect optionaldefaultASPECT_DEFAULT

The aspect ratio (w/h)

{number} near optionaldefaultZPLANE_MIN

The near plane distance

{number} far optionaldefaultZPLANE_MAX

The far plane distance

Returns

{Matrix4Ortho}

#extend153-155

The vertical extend of the viewcube

Signature

{number} Matrix4Ortho#extend

#aspect161-163

The aspect ratio (w/h)

Signature

{number} Matrix4Ortho#aspect

#near169-171

The near plane distance

Signature

{number} Matrix4Ortho#near

#far177-179

The far plane distance

Signature

{number} Matrix4Ortho#far

#copyOf(m)187-196

The copy of m

Signature

{Matrix4Ortho} Matrix4Ortho#copyOf({Matrix4Ortho} m)

Arguments

{Matrix4Ortho} m

The source

Returns

{Matrix4Ortho}

/source/Vector2.js:Vector24-602

Two component vector

Import

import { Vector2 } from 'xyzw/source/Vector2.js'

.X(target)11-18

Returns an instance representing the x axis

Signature

{Vector2} Vector2.X([{Vector2} target])

Arguments

{Vector2} target optional

The target instance

Returns

{Vector2}

.Y(target)25-32

Returns an instance representing the y axis

Signature

{Vector2} Vector2.Y([{Vector2} target])

Arguments

{Vector2} target optional

The target instance

Returns

{Vector2}

.Rotation(rad, target)40-50

Returns a unit instance from rad

Signature

{Vector2} Vector2.Rotation({number} rad [, {Vector2} target])

Arguments

{number} rad

The rotation in radians

{Vector2} target optional

The target instance

Returns

{Vector2}

.BarycentricUV(v0, v1, v2, u, v, target)62-75

Returns the resulting instance of cw triangle (v0,v1,v2) and barycentric coordinates (u,v)

Signature

{Vector2} Vector2.BarycentricUV({Vector2} v0, {Vector2} v1, {Vector2} v2, {number} u, {number} v [, {Vector2} target])

Arguments

{Vector2} v0

The first corner

{Vector2} v1

The second corner

{Vector2} v2

The third corner

{number} u

The u-coordinate

{number} v

The v-coordinate

{Vector2} target optional

The target instance

Returns

{Vector2}

.Add(v, w, target)85-87

Returns the sum of v and w (v+w)

Signature

{Vector2} Vector2.Add({Vector2} v, {Vector2} w [, {Vector2} target])

Arguments

{Vector2} v

The first summand

{Vector2} w

The second summand

{Vector2} target optional

The target instance

Returns

{Vector2}

.Subtract(v, w, target)96-98

Returns the difference of v and w (v-w)

Signature

{Vector2} Vector2.Subtract({Vector2} v, {Vector2} w [, {Vector2} target])

Arguments

{Vector2} v

The minuend

{Vector2} w

The subtrahend

{Vector2} target optional

The target instance

Returns

{Vector2}

.MultiplyScalar(v, n, target)107-109

Returns the scalar product of v and n (v*n)

Signature

{Vector2} Vector2.MultiplyScalar({Vector2} v, {number} n [, {Vector2} target])

Arguments

{Vector2} v

The vector

{number} n

The scalar

{Vector2} target optional

The target instance

Returns

{Vector2}

.MultiplyMatrix2(m, v, target)118-120

Returns the transformation of v (m*v)

Signature

{Vector2} Vector2.MultiplyMatrix2({Matrix2} m, {Vector2} v [, {Vector2} target])

Arguments

{Matrix2} m

The transform

{Vector2} v

The vector

{Vector2} target optional

The target instance

Returns

{Vector2}

.Multiply2x3Matrix3(m, v, target)129-131

Returns the 2x3 transformation of v (m*v)

Signature

{Vector2} Vector2.Multiply2x3Matrix3({Matrix3} m, {Vector2} v [, {Vector2} target])

Arguments

{Matrix3} m

The transform

{Vector2} v

The vector

{Vector2} target optional

The target instance

Returns

{Vector2}

.MultiplyMatrix3(m, v, target)140-142

Returns the transformation of v (m*v)

Signature

{Vector2} Vector2.MultiplyMatrix3({Matrix3} m, {Vector2} v [, {Vector2} target])

Arguments

{Matrix3} m

The transform

{Vector2} v

The vector

{Vector2} target optional

The target instance

Returns

{Vector2}

.Project(v, w, target)151-153

Returns the orthogonal projection of w on v

Signature

{Vector2} Vector2.Project({Vector2} v, {Vector2} w [, {Vector2} target])

Arguments

{Vector2} v

The projection vector

{Vector2} w

The projected vector

{Vector2} target optional

The target instance

Returns

{Vector2}

.Normalize(v, target)161-163

Returns a normal form of v

Signature

{Vector2} Vector2.Normalize({Vector2} v [, {Vector2} target])

Arguments

{Vector2} v

The source

{Vector2} target optional

The target instance

Returns

{Vector2}

.Perpendicular(v, target)171-173

Returns a perpendicular dot product of v

Signature

{Vector2} Vector2.Perpendicular({Vector2} v [, {Vector2} target])

Arguments

{Vector2} v

The source

{Vector2} target optional

The target instance

Returns

{Vector2}

.Copy(v, target)181-183

Returns a copy of v

Signature

{Vector2} Vector2.Copy({Vector2} v [, {Vector2} target])

Arguments

{Vector2} v

The source

{Vector2} target optional

The target instance

Returns

{Vector2}

.cross(v, w)192-194

Returns the outer product of v and w (v cross w)

Signature

{number} Vector2.cross({Vector2} v, {Vector2} w)

Arguments

{Vector2} v

The first vector

{Vector2} w

The second vector

Returns

{number}

.dot(v, w)202-204

Returns the inner product of v and w (v dot w)

Signature

{number} Vector2.dot({Vector2} v, {Vector2} w)

Arguments

{Vector2} v

The first vector

{Vector2} w

The second vector

Returns

{number}

.rad(v, w)212-214

Returns the angle in radians between v and w (acos(v dot w))

Signature

{number} Vector2.rad({Vector2} v, {Vector2} w)

Arguments

{Vector2} v

The first vector

{Vector2} w

The second vector

Returns

{number}

.isEQ(v, w)223-227

Returns true if v and w are equal, false otherwise

Signature

{boolean} Vector2.isEQ({Vector2} v, {Vector2} w)

Arguments

{Vector2} v

The protagonist

{Vector2} w

The antagonist

Returns

{boolean}

#constructor(n)235-241

Creates a new instance

Signature

{undefined} Vector2#constructor([{number[]} n])

Arguments

{number[]} n optional

Array representing the two components Arrays of length !== 2 will return the zero (0,0) vector

Returns

No return value

#n240-240

The component array

Signature

{number[]} Vector2#n

#define(n)249-253

Redefines the instance

Signature

{Vector2} Vector2#define({number[]} n)

Arguments

{number[]} n

Array representing the two components

Returns

{Vector2}

#x260-262

The x component Vector2#n[0]

Signature

{number} Vector2#x

#y272-274

The y component Vector2#n[1]

Signature

{number} Vector2#y

#s285-287

The s component Alias of Vector2#x

Signature

{number} Vector2#s

#t298-300

The t component Alias of Vector2#y

Signature

{number} Vector2#t

#norm311-315

The norm

Signature

{number} Vector2#norm

#normSquared321-325

The square of the norm (norm*norm)

Signature

{number} Vector2#normSquared

#add(v, w)334-339

The sum of v and w (v+w)

Signature

{Vector2} Vector2#add({Vector2} v, {Vector2} w)

Arguments

{Vector2} v

The first summand

{Vector2} w

The second summand

Returns

{Vector2}

#subtract(v, w)347-352

The difference of v and w (v-w)

Signature

{Vector2} Vector2#subtract({Vector2} v, {Vector2} w)

Arguments

{Vector2} v

The minuend

{Vector2} w

The subtrahend

Returns

{Vector2}

#multiplyScalar(v, n)360-365

The scalar product of v and n (v*n)

Signature

{Vector2} Vector2#multiplyScalar({Vector2} v, {number} n)

Arguments

{Vector2} v

The vector

{number} n

The scalar

Returns

{Vector2}

#multiplyMatrix2(m, v)373-380

The transformation of v (m*v)

Signature

{Vector2} Vector2#multiplyMatrix2({Matrix2} m, {Vector2} v)

Arguments

{Matrix2} m

The transform

{Vector2} v

The vector

Returns

{Vector2}

#multiply2x3Matrix3(m, v)388-395

The 2x3 transformation of v (m*v)

Signature

{Vector2} Vector2#multiply2x3Matrix3({Matrix3} m, {Vector2} v)

Arguments

{Matrix3} m

The transform

{Vector2} v

The vector

Returns

{Vector2}

#multiplyMatrix3(m, v)403-411

The transformation of v (m*v)

Signature

{Vector2} Vector2#multiplyMatrix3({Matrix3} m, {Vector2} v)

Arguments

{Matrix3} m

The transform

{Vector2} v

The vector

Returns

{Vector2}

#project(v, w)419-427

The orthogonal projection of w on v

Signature

{Vector2} Vector2#project({Vector2} v, {Vector2} w)

Arguments

{Vector2} v

The projection vector

{Vector2} w

The projected vector

Returns

{Vector2}

#minXY(v, w)435-442

The componentwise minimum of v and w (min(v,w))

Signature

{Vector2} Vector2#minXY({Vector2} v, {Vector2} w)

Arguments

{Vector2} v

The first vector

{Vector2} w

The second vector

Returns

{Vector2}

#maxXY(v, w)450-457

The componentwise maximum of v and w (max(v,w))

Signature

{Vector2} Vector2#maxXY({Vector2} v, {Vector2} w)

Arguments

{Vector2} v

The first vector

{Vector2} w

The second vector

Returns

{Vector2}

#addEQ(w)465-470

The sum of the instance and w (v+w)

Signature

{Vector2} Vector2#addEQ({Vector2} w)

Arguments

{Vector2} w

The second summand

Returns

{Vector2}

#subtractEQ(w)477-482

The difference of the instance and w (v-w)

Signature

{Vector2} Vector2#subtractEQ({Vector2} w)

Arguments

{Vector2} w

The subtrahend

Returns

{Vector2}

#multiplyScalarEQ(n)489-494

The scalar product of the instance and n (v*n)

Signature

{Vector2} Vector2#multiplyScalarEQ({number} n)

Arguments

{number} n

The scalar

Returns

{Vector2}

#projectEQ(w)501-509

The orthogonal projection of w on the instance

Signature

{Vector2} Vector2#projectEQ({Vector2} w)

Arguments

{Vector2} w

The projected vector

Returns

{Vector2}

#normalizationOf(v)517-526

The normal form of v

Signature

{Vector2} Vector2#normalizationOf({Vector2} v)

Arguments

{Vector2} v

The source

Returns

{Vector2}

#perpendicularOf(v)533-539

The perpendicular dot product of v

Signature

{Vector2} Vector2#perpendicularOf({Vector2} v)

Arguments

{Vector2} v

The source

Returns

{Vector2}

#copyOf(v)546-550

The copy of v

Signature

{Vector2} Vector2#copyOf({Vector2} v)

Arguments

{Vector2} v

The source

Returns

{Vector2}

#normalize()557-567

The normal form of the instance

Signature

{Vector2} Vector2#normalize()

Arguments

None

Returns

{Vector2}

#perpendicular()573-579

The perpendicular dot product of the instance

Signature

{Vector2} Vector2#perpendicular()

Arguments

None

Returns

{Vector2}

#toString(digits)587-593

Returns a string representation of the instance

Signature

{string} Vector2#toString([{int} digits=3])

Arguments

{int} digits optionaldefault3

The decimal digits

Returns

{string}

#valueOf()599-601

Returns the Vector2#norm of the instance

Signature

{number} Vector2#valueOf()

Arguments

None

Returns

{number}

/source/Vector3.js:Vector34-612

Three component vector

Import

import { Vector3 } from 'xyzw/source/Vector3.js'

.X(target)11-18

Returns a representation of the x-axis vector (1.0,0.0,0.0)

Signature

{Vector3} Vector3.X([{Vector3} target])

Arguments

{Vector3} target optional

The target instance

Returns

{Vector3}

.Y(target)25-32

Returns a representation of the y-axis vector (0.0,1.0,0.0)

Signature

{Vector3} Vector3.Y([{Vector3} target])

Arguments

{Vector3} target optional

The target instance

Returns

{Vector3}

.Z(target)39-46

Returns a representation of the z-axis vector (0.0,0.0,1.0)

Signature

{Vector3} Vector3.Z([{Vector3} target])

Arguments

{Vector3} target optional

The target instance

Returns

{Vector3}

.BarycentricUV(v0, v1, v2, u, v, target)59-70

Returns the resulting instance of cw triangle (v0,v1,v2) and barycentric coordinates (u,v)

Signature

{Vector3} Vector3.BarycentricUV({Vector3} v0, {Vector3} v1, {Vector3} v2, {number} u, {number} v [, {Vector3} target])

Arguments

{Vector3} v0

The first corner

{Vector3} v1

The second corner

{Vector3} v2

The third corner

{number} u

The u-coordinate

{number} v

The v-coordinate

{Vector3} target optional

The target instance

Returns

{Vector3}

.Add(v, w, target)80-82

Returns the sum of v and w (v+w)

Signature

{Vector3} Vector3.Add({Vector3} v, {Vector3} w [, {Vector3} target])

Arguments

{Vector3} v

The first summand

{Vector3} w

The second summand

{Vector3} target optional

The target instance

Returns

{Vector3}

.Subtract(v, w, target)91-93

Returns the difference between v and w (v-w)

Signature

{Vector3} Vector3.Subtract({Vector3} v, {Vector3} w [, {Vector3} target])

Arguments

{Vector3} v

The minuend

{Vector3} w

The subtrahend

{Vector3} target optional

The target instance

Returns

{Vector3}

.MultiplyScalar(v, n, target)102-104

Returns the scalar product of v and n (v*n)

Signature

{Vector3} Vector3.MultiplyScalar({Vector3} v, {number} n [, {Vector3} target])

Arguments

{Vector3} v

The vector

{number} n

The scalar

{Vector3} target optional

The target instance

Returns

{Vector3}

.Cross(v, w, target)113-115

Returns the exterior product of v and w (v cross w)

Signature

{Vector3} Vector3.Cross({Vector3} v, {Vector3} w [, {Vector3} target])

Arguments

{Vector3} v

The first vector

{Vector3} w

The second vector

{Vector3} target optional

The target instance

Returns

{Vector3}

.MultiplyMatrix3(m, v, target)124-126

Returns the transformation of v (m*v)

Signature

{Vector3} Vector3.MultiplyMatrix3({Matrix3} m, {Vector3} v [, {Vector3} target])

Arguments

{Matrix3} m

The transform

{Vector3} v

The source

{Vector3} target optional

The target instance

Returns

{Vector3}

.Multiply3x4Matrix4(m, v, target)135-137

Returns the 3x4 transformation of v (m*v)

Signature

{Vector3} Vector3.Multiply3x4Matrix4({Matrix4} m, {Vector3} v [, {Vector3} target])

Arguments

{Matrix4} m

The transform

{Vector3} v

The vector

{Vector3} target optional

The target instance

Returns

{Vector3}

.MultiplyMatrix4(m, v, target)146-148

Returns the transformation of v (m*v)

Signature

{Vector3} Vector3.MultiplyMatrix4({Matrix4} m, {Vector3} v [, {Vector3} target])

Arguments

{Matrix4} m

The transform

{Vector3} v

The vector

{Vector3} target optional

The target instance

Returns

{Vector3}

.Project(v, w, target)158-160

Returns the projection of w on v

Signature

{Vector3} Vector3.Project({Vector3} v, {Vector3} w [, {Vector3} target])

Arguments

{Vector3} v

The projection vector

{Vector3} w

The projected vector

{Vector3} target optional

The target instance

Returns

{Vector3}

.OrthoNormalize(v, w, target)169-171

Returns the orthonormalization of w against v

Signature

{Vector3} Vector3.OrthoNormalize({Vector3} v, {Vector3} w [, {Vector3} target])

Arguments

{Vector3} v

The projection vector

{Vector3} w

The projected vector

{Vector3} target optional

The target instance

Returns

{Vector3}

.Normalize(v, target)180-182

Returns the normal form of v

Signature

{Vector3} Vector3.Normalize({Vector3} v [, {Vector3} target])

Arguments

{Vector3} v

The source

{Vector3} target optional

The target instance

Returns

{Vector3}

.Copy(v, target)190-192

Returns a copy of v

Signature

{Vector3} Vector3.Copy({Vector3} v [, {Vector3} target])

Arguments

{Vector3} v

The source

{Vector3} target optional

The target instance

Returns

{Vector3}

.dot(v, w)201-203

Returns the inner product of v and w (v dot w)

Signature

{number} Vector3.dot({Vector3} v, {Vector3} w)

Arguments

{Vector3} v

The first vector

{Vector3} w

The second vector

Returns

{number}

.isEQ(v, w)212-216

Returns true if v and w are equal, false otherwise (u==v)

Signature

{boolean} Vector3.isEQ({Vector3} v, {Vector3} w)

Arguments

{Vector3} v

The protagonist

{Vector3} w

The antagonist

Returns

{boolean}

.isNormLT(v, n)224-226

Returns true if the norm of v is less than n, false otherwise (v.norm

Signature

{boolean} Vector3.isNormLT({Vector3} v, {number} n)

Arguments

{Vector3} v

The protagonist

{number} n

The antagonist

Returns

{boolean}

.isNormGT(v, n)234-236

Returns true if the norm of v is greater than n, false otherwise (v.norm>n)

Signature

{boolean} Vector3.isNormGT({Vector3} v, {number} n)

Arguments

{Vector3} v

The protagonist

{number} n

The antagonist

Returns

{boolean}

.isNormEQ(v, n)244-246

Returns true if the norm of v and n are equal, false otherwise (v.norm===n)

Signature

{boolean} Vector3.isNormEQ({Vector3} v, {number} n)

Arguments

{Vector3} v

The protagonist

{number} n

The antagonist

Returns

{boolean}

#constructor(n)255-261

Creates a new instance

Signature

{undefined} Vector3#constructor([{number[]} n])

Arguments

{number[]} n optional

Array representing the three components Arrays of length !== 3 will return the zero (0.0,0.0,0.0) vector

Returns

No return value

#n260-260

The component array

Signature

{number[]} Vector3#n

#define(n)270-274

Redefines the instance

Signature

{Vector3} Vector3#define([{number[]} n])

Arguments

{number[]} n optional

Array representing the three components Arrays of length !== 3 will return the zero (0.0,0.0,0.0) vector

Returns

{Vector3}

#x281-283

The x component, Vector3#n[0]

Signature

{number} Vector3#x

#y294-296

The y component, Vector3#n[1]

Signature

{number} Vector3#y

#z307-309

The z component, Vector3#n[2]

Signature

{number} Vector3#z

#norm320-324

The norm

Signature

{number} Vector3#norm

#normSquared330-334

The square of the norm (norm*norm)

Signature

{number} Vector3#normSquared

#add(v, w)343-349

The sum of v and w (v+w)

Signature

{Vector3} Vector3#add({Vector3} v, {Vector3} w)

Arguments

{Vector3} v

The first summand

{Vector3} w

The second summand

Returns

{Vector3}

#subtract(v, w)357-363

The difference of v and w (v-w)

Signature

{Vector3} Vector3#subtract({Vector3} v, {Vector3} w)

Arguments

{Vector3} v

The minuend

{Vector3} w

The subtrahend

Returns

{Vector3}

#multiplyScalar(v, n)371-377

The scalar product of v and n (v*n)

Signature

{Vector3} Vector3#multiplyScalar({Vector3} v, {number} n)

Arguments

{Vector3} v

The vector

{number} n

The scalar

Returns

{Vector3}

#cross(v, w)385-391

The exterior product of v and w (v cross w)

Signature

{Vector3} Vector3#cross({Vector3} v, {Vector3} w)

Arguments

{Vector3} v

The first vector

{Vector3} w

The second vector

Returns

{Vector3}

#multiplyMatrix3(m, v)399-408

The transformation of v (m*v)

Signature

{Vector3} Vector3#multiplyMatrix3({Matrix3} m, {Vector3} v)

Arguments

{Matrix3} m

The transform

{Vector3} v

The source

Returns

{Vector3}

#multiply3x4Matrix4(m, v)416-424

The 3x4 transformation of v (m*v)

Signature

{Vector3} Vector3#multiply3x4Matrix4({Matrix4} m, {Vector3} v)

Arguments

{Matrix4} m

The transform

{Vector3} v

The vector

Returns

{Vector3}

#multiplyMatrix4(m, v)432-441

The transformation of v (m*v)

Signature

{Vector3} Vector3#multiplyMatrix4({Matrix4} m, {Vector3} v)

Arguments

{Matrix4} m

The transform

{Vector3} v

The vector

Returns

{Vector3}

#project(v, w)449-457

The projection of w on v

Signature

{Vector3} Vector3#project({Vector3} v, {Vector3} w)

Arguments

{Vector3} v

The projection vector

{Vector3} w

The projected vector

Returns

{Vector3}

#orthoNormalize(v, w)466-474

The orthonormalization of w against v Gram-Schmidt-Normalization: t -= n * (t dot n)

Signature

{Vector3} Vector3#orthoNormalize({Vector3} v, {Vector3} w)

Arguments

{Vector3} v

The projection vector

{Vector3} w

The projected vector

Returns

{Vector3}

#addEQ(w)482-488

The sum of the instance and w

Signature

{Vector3} Vector3#addEQ({Vector3} w)

Arguments

{Vector3} w

The second summand

Returns

{Vector3}

#subtractEQ(w)495-501

The difference of the instance and w

Signature

{Vector3} Vector3#subtractEQ({Vector3} w)

Arguments

{Vector3} w

The subtrahend

Returns

{Vector3}

#multiplyScalarEQ(n)508-514

The scalar product of the instance and n

Signature

{Vector3} Vector3#multiplyScalarEQ({number} n)

Arguments

{number} n

the scalar

Returns

{Vector3}

#projectEQ(w)521-529

The projection of w on the instance

Signature

{Vector3} Vector3#projectEQ({Vector3} w)

Arguments

{Vector3} w

The projected vector

Returns

{Vector3}

#orthoNormalizeEQ(v)537-544

The orthonormalization of the instance against v Gram-Schmidt-Normalization: t -= n * (t dot n)

Signature

{Vector3} Vector3#orthoNormalizeEQ({Vector3} v)

Arguments

{Vector3} v

The projection vector

Returns

{Vector3}

#normalizationOf(v)552-561

The normal form of v

Signature

{Vector3} Vector3#normalizationOf({Vector3} v)

Arguments

{Vector3} v

The source

Returns

{Vector3}

#copyOf(v)568-572

The copy of v

Signature

{Vector3} Vector3#copyOf({Vector3} v)

Arguments

{Vector3} v

The source

Returns

{Vector3}

#normalize()579-589

The normal form of the instance

Signature

{Vector3} Vector3#normalize()

Arguments

None

Returns

{Vector3}

#toString(digits)597-603

Returns a string representation of the instance

Signature

{string} Vector3#toString([{int} digits=3])

Arguments

{int} digits optionaldefault3

The decimal digits

Returns

{string}

#valueOf()609-611

Returns the Vector3#norm of the instance

Signature

{number} Vector3#valueOf()

Arguments

None

Returns

{number}

/source/Vector4.js:Vector44-555

Four component vector

Import

import { Vector4 } from 'xyzw/source/Vector4.js'

.Rotation(axis, rad, target)13-27

Returns a unit-quaternion instance of axis and rotation

Signature

{Vector4} Vector4.Rotation({Vector3} axis, {number} rad [, {Vector4} target])

Arguments

{Vector3} axis

The rotation axis

{number} rad

The rotation in radians

{Vector4} target optional

The target instance

Returns

{Vector4}

.SLERP(q, r, t, target)37-58

Returns a unit-quaternion instance of Spherical Linear intERPolation

Signature

{Vector4} Vector4.SLERP({Vector4} q, {Vector4} r, {number} t [, {Vector4} target])

Arguments

{Vector4} q

The starting unit quaternion

{Vector4} r

The ending unit quaternion

{number} t

The interpolation factor

{Vector4} target optional

The target instance

Returns

{Vector4}

.Matrix3(m, target)66-107

Returns a unit-quaternion instance of a rotation matrix

Signature

{Vector4} Vector4.Matrix3({Matrix3} m [, {Vector4} target])

Arguments

{Matrix3} m

The source 3x3 transform

{Vector4} target optional

The target instance

Returns

{Vector4}

.Vector3(v, target)115-122

Returns a instance of Vector3

Signature

{Vector4} Vector4.Vector3({Vector3} v [, {Vector4} target])

Arguments

{Vector3} v

The source

{Vector4} target optional

The target instance

Returns

{Vector4}

.Add(q, r, target)132-134

Returns the sum of q and r (q+r)

Signature

{Vector4} Vector4.Add({Vector4} q, {Vector4} r [, {Vector4} target])

Arguments

{Vector4} q

The first summand

{Vector4} r

The second summand

{Vector4} target optional

The target instance

Returns

{Vector4}

.Subtract(q, r, target)143-145

Returns the difference of q and r (q-r)

Signature

{Vector4} Vector4.Subtract({Vector4} q, {Vector4} r [, {Vector4} target])

Arguments

{Vector4} q

The minuend

{Vector4} r

The subtrahend

{Vector4} target optional

The target instance

Returns

{Vector4}

.MultiplyScalar(q, n, target)154-156

Returns the scalar product of q and n (q*n)

Signature

{Vector4} Vector4.MultiplyScalar({Vector4} q, {number} n [, {Vector4} target])

Arguments

{Vector4} q

The vector

{number} n

The scalar

{Vector4} target optional

The target instance

Returns

{Vector4}

.Multiply(q, r, target)165-167

Returns the exterior product of q and r (q*r)

Signature

{Vector4} Vector4.Multiply({Vector4} q, {Vector4} r [, {Vector4} target])

Arguments

{Vector4} q

The first vector

{Vector4} r

The second vector

{Vector4} target optional

The target instance

Returns

{Vector4}

.Normalize(q, target)176-178

Returns the normal form of q

Signature

{Vector4} Vector4.Normalize({Vector4} q [, {Vector4} target])

Arguments

{Vector4} q

The source

{Vector4} target optional

The target instance

Returns

{Vector4}

.Conjugate(q, target)186-188

Returns the conjugate of q

Signature

{Vector4} Vector4.Conjugate({Vector4} q [, {Vector4} target])

Arguments

{Vector4} q

The source

{Vector4} target optional

The target instance

Returns

{Vector4}

.Inverse(q, target)196-198

Returns the inverse of q

Signature

{Vector4} Vector4.Inverse({Vector4} q [, {Vector4} target])

Arguments

{Vector4} q

The source

{Vector4} target optional

The target instance

Returns

{Vector4}

.Copy(q, target)206-208

Returns a copy of q

Signature

{Vector4} Vector4.Copy({Vector4} q [, {Vector4} target])

Arguments

{Vector4} q

The source

{Vector4} target optional

The target instance

Returns

{Vector4}

.dot(q, r)217-219

Returns the inner product of q and r

Signature

{number} Vector4.dot({Vector4} q, {Vector4} r)

Arguments

{Vector4} q

The first vector

{Vector4} r

The second vector

Returns

{number}

.isEQ(q, r)228-232

Returns true if q and r are equal, false otherwise (q==r)

Signature

{boolean} Vector4.isEQ({Vector4} q, {Vector4} r)

Arguments

{Vector4} q

The protagonist

{Vector4} r

The antagonist

Returns

{boolean}

#constructor(n)241-247

Creates a new instance

Signature

{undefined} Vector4#constructor([{number[]} n])

Arguments

{number[]} n optional

Array representing the four components Arrays of length !== 4 will return the identity (0.0,0.0,0.0,1.0) vector

Returns

No return value

#n246-246

The component array

Signature

{number[]} Vector4#n

#define(n)256-260

Redefines the instance

Signature

{Vector4} Vector4#define([{number[]} n])

Arguments

{number[]} n optional

Array representing the four components Arrays of length !== 4 will return the identity (0.0,0.0,0.0,1.0) vector

Returns

{Vector4}

#x267-269

The x component, Vector4#n[0]

Signature

{number} Vector4#x

#y280-282

The y component, Vector4#n[1]

Signature

{number} Vector4#y

#z293-295

The z component, Vector4#n[2]

Signature

{number} Vector4#z

#w306-308

The w component, Vector4#n[3]

Signature

{number} Vector4#w

#norm319-323

The norm of the instance

Signature

{number} Vector4#norm

#normSquared329-333

The square of the norm of the instance

Signature

{} Vector4#normSquared

#add(q, r)342-349

The sum of q and r (q+r)

Signature

{Vector4} Vector4#add({Vector4} q, {Vector4} r)

Arguments

{Vector4} q

The first summand

{Vector4} r

The second summand

Returns

{Vector4}

#subtract(q, r)357-364

The difference of q and r (q-r)

Signature

{Vector4} Vector4#subtract({Vector4} q, {Vector4} r)

Arguments

{Vector4} q

The minuend

{Vector4} r

The subtrahend

Returns

{Vector4}

#multiplyScalar(q, n)372-379

The scalar product of q and n (q*n)

Signature

{Vector4} Vector4#multiplyScalar({Vector4} q, {number} n)

Arguments

{Vector4} q

The vector

{number} n

The scalar

Returns

{Vector4}

#multiply(q, r)387-397

The exterior product of q and r (q cross r)

Signature

{Vector4} Vector4#multiply({Vector4} q, {Vector4} r)

Arguments

{Vector4} q

The first vector

{Vector4} r

The second vector

Returns

{Vector4}

#addEQ(q)405-412

The sum of the instance and q

Signature

{Vector4} Vector4#addEQ({Vector4} q)

Arguments

{Vector4} q

The second summand

Returns

{Vector4}

#subtractEQ(q)419-426

The difference of the instance and q

Signature

{Vector4} Vector4#subtractEQ({Vector4} q)

Arguments

{Vector4} q

The subtrahend

Returns

{Vector4}

#multiplyScalarEQ(n)433-440

The scalar product of the instance and n

Signature

{Vector4} Vector4#multiplyScalarEQ({number} n)

Arguments

{number} n

the scalar

Returns

{Vector4}

#normalizationOf(q)448-457

The normalization of q

Signature

{Vector4} Vector4#normalizationOf({Vector4} q)

Arguments

{Vector4} q

The source vector

Returns

{Vector4}

#conjugateOf(q)464-471

The conjugate of q

Signature

{Vector4} Vector4#conjugateOf({Vector4} q)

Arguments

{Vector4} q

The source

Returns

{Vector4}

#inverseOf(q)478-488

The inverse of q

Signature

{Vector4} Vector4#inverseOf({Vector4} q)

Arguments

{Vector4} q

The source

Returns

{Vector4}

#copyOf(q)495-499

The copy of q

Signature

{Vector4} Vector4#copyOf({Vector4} q)

Arguments

{Vector4} q

The source

Returns

{Vector4}

#normalize()506-516

The normal form of the instance

Signature

{Vector4} Vector4#normalize()

Arguments

None

Returns

{Vector4}

#conjugate()522-524

The conjugate of the instance

Signature

{Vector4} Vector4#conjugate()

Arguments

None

Returns

{Vector4}

#invert()530-532

The inverse of the instance

Signature

{Vector4} Vector4#invert()

Arguments

None

Returns

{Vector4}

#toString(digits)540-546

Returns a string representation of the instance

Signature

{string} Vector4#toString([{int} digits=3])

Arguments

{int} digits optionaldefault3

The decimal digits

Returns

{string}

#valueOf()552-554

Returns the Vector4#norm of the instance

Signature

{number} Vector4#valueOf()

Arguments

None

Returns

{number}