Options
All
  • Public
  • Public/Protected
  • All
Menu

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]

Hierarchy

  • Plane

Index

Constructors

constructor

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

    Parameters

    • A: number
    • B: number
    • C: number
    • D: number

    Returns Plane

Accessors

Readonly A

A: number

The A coefficient of the plane equation

Readonly B

B: number

The B coefficient of the plane equation

Readonly C

C: number

The C coefficient of the plane equation

Readonly D

D: number

The D coefficient of the plane equation

Methods

equals

  • Returns true if the planes are equal.

    Parameters

    Returns boolean

getDistance

  • Returns the distance between the give point and this plane

    Parameters

    Returns number

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.

    Parameters

    Returns number

getNormal

  • Returns the distance between the give point and this plane

    Returns Vec3Like

Static from

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

    Parameters

    Returns Plane

Static fromPointAndNormal

  • Returns a plane created from a point and a normal

    Parameters

    Returns Plane

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

    Parameters

    Returns Plane

Generated using TypeDoc