Math module

Complex

typeSource

A complex number as a Vector2 (x real, y imaginary), declared #type,isa Vector2: a distinct type that converts to Vector2 where one is expected, so length, dot and the vector operators accept it. The module defines no complex multiplication or division of its own.

ExampleOpen in playground ↗
c: Complex;
c.x = 3;
c.y = 4;
assert(length(c) == 5);
Complex :: #type,isa Vector2

See also