# B.Math.Plane()

Represents a plane.

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

## CONSTANTS:

X = {normal: B.Math.Vector3.X, distance: 0}

Positive direction along X-axis.

Y = {normal: B.Math.Vector3.Y, distance: 0}

Positive direction along Y-axis.

Z = {normal: B.Math.Vector3.Z, distance: 0}

Positive direction along Z-axis.

N_X = {normal: B.Math.Vector3.N_X, distance: 0}

Negative direction along X-axis.

N_Y = {normal: B.Math.Vector3.N_Y, distance: 0}

Negative direction along Y-axis.

N_Z = {normal: B.Math.Vector3.N_Z, distance: 0}

Negative direction along Z-axis.

## PROPERTIES:

normal

Normal of the plane.

{number} distance

Distance to the plane along the normal.

## METHODS:

clone()

Clones this plane to a new plane.

### RETURNS:

this

copy(plane)

Copies a given plane into this plane.

plane

### RETURNS:

this

set(normal, distance)

Sets this plane from a normal and a distance.

### PARAMETERS:

normal

{number} distance

### RETURNS:

this

fromArray(array, offset)

Sets this plane from a part of array.

### PARAMETERS:

{Array.<number>} array

{number} [offset] = 0

### RETURNS:

{number}

new offset

toArray(array, offset)

Sets this plane to a part of array.

### PARAMETERS:

{Array.<number>} array

{number} [offset] = 0

### RETURNS:

{number}

new offset

fromNormalPoint(normal, point)

Sets this plane from a normal and a point.

normal

point

### RETURNS:

this

fromCoplanarPoints(a, b, c)

Sets this plane from three coplanar points.

### RETURNS:

this

translate(offset)

Translates this plane by a given offset.

offset

### RETURNS:

this

transform(matrix)

Transforms this plane by a 4x4 matrix.

matrix

### RETURNS:

this

normalize()

Normalizes this plane.

### RETURNS:

this

negate()

Negates this plane.

### RETURNS:

this

projectPoint(point, result)

Projects a point to this plane.

### PARAMETERS:

point

[result]

omit if you want to return newly created vector

### RETURNS:

projected point

distanceTo(object)

Calculates the shortest distance between this plane and an object.

object

{number}

distance

### THROWS:

{Error}

if the object argument has unsupported type

test(object, relation)

Tests relation between this plane and an object.

object

relation

{boolean}

### THROWS:

{Error}

if the object argument has unsupported type.

equal(plane)

Checks for strict equality of this plane and another plane.

plane

{boolean}