Re: [swift-evolution] [Pitch] Angle Type

2018-01-16 Thread Erica Sadun via swift-evolution
> On Jan 15, 2018, at 2:40 PM, Stephen Canon via swift-evolution > wrote: > > > >> On Jan 15, 2018, at 4:31 PM, Karl Wagner via swift-evolution >> > wrote: >> >>> On 14. Jan 2018, at 21:12, Kelvin Ma

Re: [swift-evolution] [Pitch] Angle Type

2018-01-16 Thread Karl Wagner via swift-evolution
> On 15. Jan 2018, at 23:55, Taylor Swift wrote: > > > > On Jan 15, 2018, at 3:30 PM, Karl Wagner > wrote: > >> >> >>> On 14. Jan 2018, at 21:12, Kelvin Ma via swift-evolution >>>

Re: [swift-evolution] [Pitch] Angle Type

2018-01-15 Thread Taylor Swift via swift-evolution
> On Jan 15, 2018, at 3:40 PM, Stephen Canon wrote: > > > >>> On Jan 15, 2018, at 4:31 PM, Karl Wagner via swift-evolution >>> wrote: >>> >>> On 14. Jan 2018, at 21:12, Kelvin Ma via swift-evolution >>> wrote: >>>

Re: [swift-evolution] [Pitch] Angle Type

2018-01-15 Thread Taylor Swift via swift-evolution
> On Jan 15, 2018, at 3:30 PM, Karl Wagner wrote: > > > >> On 14. Jan 2018, at 21:12, Kelvin Ma via swift-evolution >> wrote: >> >> This could work, but you’re also giving up all the nice Numeric and >> FloatingPoint conformances when you

Re: [swift-evolution] [Pitch] Angle Type

2018-01-15 Thread Stephen Canon via swift-evolution
> On Jan 15, 2018, at 4:31 PM, Karl Wagner via swift-evolution > wrote: > >> On 14. Jan 2018, at 21:12, Kelvin Ma via swift-evolution >> > wrote: >> >> This could work, but you’re also giving up all the

Re: [swift-evolution] [Pitch] Angle Type

2018-01-15 Thread Karl Wagner via swift-evolution
> On 14. Jan 2018, at 21:12, Kelvin Ma via swift-evolution > wrote: > > This could work, but you’re also giving up all the nice Numeric and > FloatingPoint conformances when you use this,, all of a sudden adding two > angles together isn’t let γ = α + β, it’s γ =

Re: [swift-evolution] [Pitch] Angle Type

2018-01-14 Thread Kelvin Ma via swift-evolution
This could work, but you’re also giving up all the nice Numeric and FloatingPoint conformances when you use this,, all of a sudden adding two angles together isn’t let γ = α + β, it’s γ = Angle.radians(α.radians + β.radians). just no. at the risk of blowing up the scope of this idea, dedicated

Re: [swift-evolution] [Pitch] Angle Type

2018-01-14 Thread Karl Wagner via swift-evolution
> On 14. Jan 2018, at 06:04, BJ Homer via swift-evolution > wrote: > > An Angle type already exists in Foundation; see Measurement. You > could add some convenience methods in an extension pretty easily. > > import Foundation > > typealias Angle = Measurement >

Re: [swift-evolution] [Pitch] Angle Type

2018-01-14 Thread Karl Wagner via swift-evolution
> On 14. Jan 2018, at 09:51, Taylor Swift via swift-evolution > wrote: > > I do a lot of geometry and spherical-related work and i have never found an > Angle type to be worth having. Always use radians. It’s what sin() and cos() > take, it’s what graphics APIs

Re: [swift-evolution] [Pitch] Angle Type

2018-01-14 Thread Taylor Swift via swift-evolution
I do a lot of geometry and spherical-related work and i have never found an Angle type to be worth having. Always use radians. It’s what sin() and cos() take, it’s what graphics APIs like Cairo expect, it’s what graphics formats like SVG use. plus,, do you *really* want to be case-branching on

Re: [swift-evolution] [Pitch] Angle Type

2018-01-13 Thread BJ Homer via swift-evolution
An Angle type already exists in Foundation; see Measurement. You could add some convenience methods in an extension pretty easily. import Foundation typealias Angle = Measurement extension Measurement where UnitType == UnitAngle { var sine: Double { let radians = self.converted(to:

Re: [swift-evolution] [Pitch] Angle Type

2018-01-13 Thread Erica Sadun via swift-evolution
I would like to see a full Geometry implementation but I don't think it should be part of the standard library. I've kicked around some ideas here: * https://gist.github.com/erica/8cb4b21cf0c429828fad1d8ad459b71b *