Options
All
• Public
• Public/Protected
• All

# Class Plane

An immutable plane.

The class describes a plane by the equation: Ax + By + Cz + Dx = 0 The plane's normal is defined by the coefficients [A, B, C]

• Plane

## Constructors

### constructor

• new Plane(A: number, B: number, C: number, D: number): Plane
• Constructor

## Accessors

A: number

The A coefficient of the plane equation

B: number

The B coefficient of the plane equation

C: number

The C coefficient of the plane equation

D: number

The D coefficient of the plane equation

## Methods

### equals

• Returns true if the planes are equal.

### getDistance

• Returns the distance between the give point and this plane

### getDistanceSquared

• getDistanceSquared(point: Vec3Like): number
• Returns the square of the distance from the point to the plane

The square of the distance is relatively fast to compute (no \a sqrt) and is useful for determine which side the point is on. To obtain the actual distance, divide by sqrt(A^2 + B^2 + C^2) or use the distance() function directly.

### getNormal

• Returns the distance between the give point and this plane

### Static from

• Creates a plane instance from any object with A,B,C,D properties

### Static fromPointAndNormal

• Returns a plane created from a point and a normal

### Static fromPoints

• Returns a plane created from three points

The three points cannot be on a line as they need to define a plane. So (p2 - p1)*(p3 - p1) != 0

#### Returns Plane

Generated using TypeDoc