Math module

make_vector4

procedure · 3 overloadsSource

A Vector4 with all components set to x, or one built from a Vector3 and a w, or a Vector2 and a z and w. To build one from four numbers, write xyzw(x, y, z, w) or Vector4.{ x, y, z, w }.

ExampleOpen in playground ↗
assert(make_vector4(1) == xyzw(1, 1, 1, 1));
assert(make_vector4(xyz(1, 2, 3), 1) == xyzw(1, 2, 3, 1));
make_vector4 :: (x: float) -> Vector4

A vector with all four components set to x.

Parameters

x: float
the value for each component.

Returns

make_vector4 :: (v: Vector2, z: float, w: float) -> Vector4

Extends a Vector2 with z and w components.

Parameters

v: Vector2
supplies x and y.
z: float
the z component.
w: float
the w component.

Returns

make_vector4 :: (v: Vector3, w: float) -> Vector4

Extends a Vector3 with a w component.

Parameters

v: Vector3
supplies x, y and z.
w: float
the w component.

Returns

See also