JSDoc: Class: quat

# Class: quat

## quat

#### new quat()

Source:
  - quat.js, line 26

### Members

#### (static) equals

Returns whether or not the quaternions have approximately the same elements in the same position.

Source:
  - quat.js, line 506

#### (static) exactEquals

Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)

Source:
  - quat.js, line 497

#### (static) rotationTo

Sets a quaternion to represent the shortest rotation from one vector to another. Both vectors are assumed to be unit length.

Source:
  - quat.js, line 519

#### (static) setAxes

Sets the specified quaternion with values corresponding to the given axes. Each axis is a vec3 and is expected to be unit length and perpendicular to all other specified axes.

Source:
  - quat.js, line 584

#### (static) sqlerp

Performs a spherical linear interpolation with two control points

Source:
  - quat.js, line 561

### Methods

#### (static) add(out, a, b) → {quat}

Adds two quat's

##### Parameters:

Name | Type | Description
--- | --- | ---
`out` | quat | the receiving quaternion
`a` | quat | the first operand
`b` | quat | the second operand

Source:
  - quat.js, line 418

##### Returns:

out

Type
  quat

#### (static) clone(a) → {quat}

Creates a new quat initialized with values from an existing quaternion

##### Parameters:

Name | Type | Description
--- | --- | ---
`a` | quat | quaternion to clone

Source:
  - quat.js, line 372

##### Returns:

a new quaternion

Type
  quat

#### (static) copy(out, a) → {quat}

Copy the values from one quat to another

##### Parameters:

Name | Type | Description
--- | --- | ---
`out` | quat | the receiving quaternion
`a` | quat | the source quaternion

Source:
  - quat.js, line 394

##### Returns:

out

Type
  quat

#### (static) dot(a, b) → {Number}

Calculates the dot product of two quat's

##### Parameters:

Name | Type | Description
--- | --- | ---
`a` | quat | the first operand
`b` | quat | the second operand

Source:
  - quat.js, line 445

##### Returns:

dot product of a and b

Type
  Number

#### (static) fromValues(x, y, z, w) → {quat}

Creates a new quat initialized with the given values

##### Parameters:

Name | Type | Description
--- | --- | ---
`x` | Number | X component
`y` | Number | Y component
`z` | Number | Z component
`w` | Number | W component

Source:
  - quat.js, line 384

##### Returns:

a new quaternion

Type
  quat

#### (static) length()

Alias for quat.len

Source:
  - quat.js, line 463

#### (static) lerp(out, a, b, t) → {quat}

Performs a linear interpolation between two quat's

##### Parameters:

Name | Type | Description
--- | --- | ---
`out` | quat | the receiving quaternion
`a` | quat | the first operand
`b` | quat | the second operand
`t` | Number | interpolation amount between the two inputs

Source:
  - quat.js, line 457

##### Returns:

out

Type
  quat

#### (static) mul()

Alias for quat.multiply

Source:
  - quat.js, line 424

#### (static) normalize(out, a) → {quat}

Normalize a quat

##### Parameters:

Name | Type | Description
--- | --- | ---
`out` | quat | the receiving quaternion
`a` | quat | quaternion to normalize

Source:
  - quat.js, line 488

##### Returns:

out

Type
  quat

#### (static) scale(out, a, b) → {quat}

Scales a quat by a scalar number

##### Parameters:

Name | Type | Description
--- | --- | ---
`out` | quat | the receiving vector
`a` | quat | the vector to scale
`b` | Number | amount to scale the vector by

Source:
  - quat.js, line 435

##### Returns:

out

Type
  quat

#### (static) set(out, x, y, z, w) → {quat}

Set the components of a quat to the given values

##### Parameters:

Name | Type | Description
--- | --- | ---
`out` | quat | the receiving quaternion
`x` | Number | X component
`y` | Number | Y component
`z` | Number | Z component
`w` | Number | W component

Source:
  - quat.js, line 407

##### Returns:

out

Type
  quat

#### (static) sqrLen()

Alias for quat.squaredLength

Source:
  - quat.js, line 478

#### (static) squaredLength(a) → {Number}

Calculates the squared length of a quat

##### Parameters:

Name | Type | Description
--- | --- | ---
`a` | quat | vector to calculate squared length of

Source:
  - quat.js, line 472

##### Returns:

squared length of a

Type
  Number