# B.Math.Angles()

Represents canonical Euler angles.

To create the object use B.Math.makeAngles().

## METHODS:

clone()

Clones this angles to a new angles object.

### RETURNS:

this

copy(angles)

Copies a given angles object into this angles.

angles

### RETURNS:

this

set(yaw, pitch, roll)

Sets all elements and performs canonization.

{number} yaw

{number} pitch

{number} roll

### RETURNS:

this

get(index)

Gets an element by its index.

{number} index

{number}

### THROWS:

{Error}

if the index is out of range

yaw(angle)

Sets yaw angle (rotation around global Y-axis) and performs canonization. Range: [-PI, PI].

{number} angle

### RETURNS:

this

yaw()

Gets yaw angle (rotation around global Y-axis). Range: [-PI, PI].

### RETURNS:

{number}

pitch(angle)

Sets pitch angle (rotation around local X-axis) and performs canonization. Range: [-PI/2, PI/2].

{number} angle

### RETURNS:

this

pitch()

Gets pitch angle (rotation around local X-axis).

### RETURNS:

{number}

roll(angle)

Sets roll angle (rotation around local Z-axis) and performs canonization. Range: [-PI, PI].

{number} angle

### RETURNS:

this

roll()

Gets roll angle (rotation around local Z-axis).

### RETURNS:

{number}

fromArray(array, offset)

Sets this angles from a part of array and performs canonization.

### PARAMETERS:

{Array.<number>} array

{number} [offset] = 0

### RETURNS:

{number}

new offset

toArray(array, offset)

Sets this angles to a part of array.

### PARAMETERS:

{Array.<number>} array

{number} [offset] = 0

### RETURNS:

{number}

new offset

fromRotationMatrix(matrix)

Sets this angles from any rotation matrix.

matrix

### RETURNS:

this

fromQuaternion(q)

Sets this angles from a quaternion.

### RETURNS:

this

equal(angles)

Checks for strict equality of this angles and another angles.

angles

{boolean}