Comments (5)
Random thought...
Having Angle<T: Real>
be a struct is good, because it makes it easy to add different representations of the underlying angle. You could easily add a public var turns: T
, a public var gons: T
, etc.
from swift-numerics.
I've thought about this design in the past (and did an implementation back in Swift 2 that I never published); it would be as-well-as, rather than instead-of, but it's not actually a bad idea. You start to get into weird typing questions if you aggressively go down this path with the trig functions (by analogy, exp
should produce a result type that differs from its argument, with log
having the reverse signature, and we need to make the types relate to the angle type when we move to complex operations), but for simpler use cases it can be pretty nice.
from swift-numerics.
I'm also in favor of the Angle
type. In my code base I constantly have to keep in mind if the angle in a given block of code is in radians or degrees (hint: it's always the Angle
type).
I'd be more than happy to help here if needed. Forgive me for asking, but what is the consensus: is the issue still relevant (PR/implementation needed) or is there more discussion required?
from swift-numerics.
from swift-numerics.
Gradians are a metric version of radians. Probably not used much but handheld calculators always had a "DRG" key which supported degrees, radians, and gradians. Noticed, that Apple's calculator does not support it.
from swift-numerics.
Related Issues (20)
- Meaning of pre‐semantic versioning? HOT 7
- Missing required module HOT 7
- Add a script to generate the CMakeLists files? HOT 1
- Feature request for "relaxed" floating-point semantics HOT 2
- Floating point exponent `pow` returns NaN for integer exponents HOT 2
- Possible improvement in 'pow' Elementary Function when operands are zero HOT 5
- Should complex multiplication use augmented arithmetic? HOT 1
- Warnings in `Double.testIntegerExponent()` HOT 1
- [BigInt] Using tests from “Violet - Python VM written in Swift” HOT 5
- Duplicate symbols on Windows
- "^=" xor function code was incorrect. HOT 1
- Improve String init() execution time and fix Violet bugs
- Change default branch from `Quaternions` to `main`
- `** ARCHIVE FAILED **` due to `_NumericsShims` missing HOT 4
- Crash in `DoubleWidth` HOT 4
- Variadic GCD and LCM
- Feature request: GCD for floating-point HOT 7
- Error in Swift Playgrounds HOT 1
- Issues with CMake support HOT 3
- [FR]: Support Apple Privacy Manifest HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swift-numerics.