plane.fromNormal

The plane through a point with a given normal and a deterministic x axis.

GeometricSince 0.3.0

Usage

TypeScript
Plane.fromNormal(origin: Point3, normal: Vector3): Plane | null

Parameters

  • originPoint3

    The plane’s origin. Required. In model.

  • normalVector3

    The normal (z axis); any non-zero length. Required. In model.

Returns

A plane with unit axes and zAxis along normal; null when normal has no direction (zero length or not finite).

Guarantees

  • the axes are orthonormal and right-handed (Vector3.dot of each pair ≈ 0, Vector3.length of each ≈ 1, Vector3.cross(xAxis, yAxis) ≈ zAxis)
  • zAxis points along normal (Vector3.angleRad(zAxis, normal) ≈ 0)
  • the same normal always gives the same axes (deep equality of two calls)
  • The same result on every machine.

Use instead

Example

TypeScript
Plane.fromNormal(Point3.origin, Vector3.of(0, 0, 2)).zAxis // → { x: 0, y: 0, z: 1 }
Plane.fromNormal(Point3.origin, Vector3.zero) // → null

See also