Math module

make_vector3

procedure · 3 overloadsSource

A Vector3 with all components set to x, or one built from an array of three floats, or from a Vector2 and a z. To build one from three numbers, write xyz(x, y, z) or Vector3.{ x, y, z }.

ExampleOpen in playground ↗
assert(make_vector3(2) == xyz(2, 2, 2));
assert(make_vector3(xy(1, 2), 3) == xyz(1, 2, 3));
make_vector3 :: (x: float) -> Vector3

A vector with all three components set to x.

Parameters

x: float
the value for each component.

Returns

make_vector3 :: (c: [3] float) -> Vector3

A vector from an array of x, y, z.

Parameters

c: [3] float
the three components, in x, y, z order.

Returns

make_vector3 :: (v: Vector2, z: float) -> Vector3

Extends a Vector2 with a z component.

Parameters

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

Returns

See also