Closed jkalias closed 4 years ago
@jkalias interesting idea. UnitAngle is a class rather than a value type though, which makes it slightly unappealing for high-performance use.
Perhaps I could introduce an Angle struct similar to SwiftUI's, with some bridging to UnitAngle.
That was exactly my guess regarding the high performance requirements. I totally agree about the custom Angle struct.
I’d love to help if you feel like it.
@jkalias sure, if you'd like to make a PR that would be great.
Merged in develop.
The current API relies heavily on the use of
Double
for angles. Even though the argument label is explicit (eg. radians), there is no type safety enforced by the compiler.There exists already a type safe
Angle
implementation, however it is defined in SwiftUI (https://developer.apple.com/documentation/swiftui/angle) and therefor not suitable for this project.I’d love to update the angle-related API to use a type safe
Angle
implementation based onUnitAngle
of Foundation (https://developer.apple.com/documentation/foundation/unitangle). That way, it would make it appropriate for uniform use on the supported platforms (Apple, Linux) and increase the type safety of the library.Best regards, stay healthy and stay safe