Math module

xy

procedure · 2 overloadsSource

Builds a Vector2 from two components, or from one number for both.

ExampleOpen in playground ↗
assert(xy(1, 2) == Vector2.{ 1, 2 } && xy(3) == xy(3, 3));
xy :: (x: float, y: float) -> Vector2

Short form of Vector2.{ x, y }.

Parameters

x: float
the x component.
y: float
the y component.

Returns

xy :: (x: float) -> Vector2

A vector with both components set to x.

Parameters

x: float
the value for each component.

Returns

See also