|
|
|
|
|
by jpopesculian
107 days ago
|
|
The nice thing about turns is that they can be represented by an unsigned integer. For example with an 8 bit unsigned integer: - 0000_0000 = 0 or tau - 1000_0000 = pi - 1100_0000 = 3*pi/4 And the addition and multiplication by integer scalars all apply and the overflows work naturally. I wrote a little library in rust [0] to help with this as you can define the operations */+-% etc. [0] https://docs.rs/turns/latest/turns/ |
|