Math module

make_plane

procedure · 4 overloadsSource

Builds a Plane3 from four coefficients a, b, c, d, a Vector4, a normal and a d, or a normal and a point on the plane (then d = -dot(normal, point)). The normal is stored as given; it is not normalized.

ExampleOpen in playground ↗
p := make_plane(xyz(0, 0, 1), xyz(0, 0, 3)); // the plane z = 3
assert(p.d == -3);
assert(make_plane(1, 2, 3, 4).d == 4 && make_plane(xyz(1, 2, 3), 4).normal == xyz(1, 2, 3));
make_plane :: (a: float, b: float, c: float, d: float) -> Plane3

A plane from its coefficients, for the plane a*x + b*y + c*z + d = 0.

Parameters

a: float
the normal's x.
b: float
the normal's y.
c: float
the normal's z.
d: float
the offset.

Returns

make_plane :: (v: Vector3, d: float) -> Plane3

A plane from a normal and an offset.

Parameters

v: Vector3
the normal.
d: float
the offset, added after the dot product with the normal.

Returns

make_plane :: (v: Vector3, x: Vector3) -> Plane3

A plane with the given normal that passes through a point.

Parameters

v: Vector3
the normal.
x: Vector3
a point on the plane.

Returns

make_plane :: (v: Vector4) -> Plane3

A plane from a vector holding the normal in x, y, z and the offset in w.

Parameters

v: Vector4
the normal in x, y, z and the offset in w.

Returns

See also