-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Description
Finalize unit declaration syntax.
Goals
- Built-in support for SI units
- Ability to define postfix symbol apart of declaration
- Ability to define a relationships between units of the same type & infer conversions between all variations
Unit Declarations
Angle protocal : Number { }
rad unit : Angle @name("Radian") @SI = 1;
deg unit : Angle @name("Degree") = (π/180) rad;
turn unit : Angle @name("Turn") = 360 deg;
grad unit : Angle @name("Gradian") = (1/400) turn;
arcs unit : Angle @name("Arcsecond") = (1/3600) deg;
arcm unit : Angle @name("Arcminute") = (1/60) deg;
Usage
3 rad
5 deg to rad
rotate(3 rad)