Math module

plane_dot

procedure · 1 overloadSource

dot(plane.normal, v) + plane.d: the signed distance from point v to the plane if the normal has unit length (positive on the side of the normal, zero on the plane), otherwise that distance times the normal's length. The procedure is #symmetric, so the point may come first.

ExampleOpen in playground ↗
p := make_plane(xyz(0, 1, 0), xyz(0, 2, 0));
assert(plane_dot(p, xyz(0, 5, 0)) == 3 && plane_dot(p, xyz(0, 0, 0)) == -2);
assert(plane_dot(xyz(0, 5, 0), p) == 3);
plane_dot :: (plane: Plane3, v: Vector3) -> float

The signed distance from a point to the plane, if the normal has unit length. Positive on the side the normal faces.

Parameters

plane: Plane3
the plane.
v: Vector3
the point.

Returns

float

See also