transform.planeToPlane

The transform that maps one plane’s frame onto another’s: origin to origin, axes to axes.

GeometricSince 0.3.0

Usage

TypeScript
Transform.planeToPlane(a: Plane, b: Plane): Transform

Parameters

  • aPlane

    The source plane; its axes must be orthonormal. Required. In model.

  • bPlane

    The target plane; its axes must be orthonormal. Required. In model.

Returns

A frozen rigid transform (a rotation, or a mirror when the frames differ in handedness, plus a translation). With non-orthonormal axes the result is not the frame map; nothing reports it.

Guarantees

  • a.origin maps to b.origin (Transform.applyToPoint(xf, a.origin) ≈ b.origin)
  • each axis of a maps to the same axis of b (Transform.applyToVector(xf, a.xAxis) ≈ b.xAxis, likewise y and z)
  • distances are preserved (Point3.distance before and after)
  • The same result on every machine.

Example

TypeScript
const t = Transform.planeToPlane(Plane.worldXY, Plane.fromNormal(Point3.of(0, 0, 5), Vector3.xAxis))
Transform.applyToPoint(t, Point3.origin) // → { x: 0, y: 0, z: 5 }

See also