@@ -21,7 +21,7 @@ public typealias CartesianPoint = Point
2121
2222public extension CartesianPoint {
2323 /// The minimum axis for a `CartesianPlane` that would contain this point.
24- var minimumAxis : Float {
24+ var minimumAxis : Double {
2525 return max ( abs ( x) , abs ( y) )
2626 }
2727}
@@ -31,8 +31,9 @@ public extension CartesianPoint {
3131 ///
3232 /// Uses the mathematical **Law of Sines**.
3333 ///
34- /// - parameter radius: The straight line distance from the _origin_.
35- /// - parameter degree: The angular degree (0-360), clockwise from the x-axis.
34+ /// - parameters:
35+ /// - radius: The straight line distance from the _origin_.
36+ /// - degree: The angular degree (0-360), clockwise from the x-axis.
3637 /// - returns:A `CartesianPoint` with offsets from the _origin_.
3738 static func make( for radius: Radius , degree: Degree , clockwise: Bool = true ) throws -> CartesianPoint {
3839 guard degree >= 0.0 , degree <= 360.0 else {
@@ -47,10 +48,10 @@ public extension CartesianPoint {
4748 return . zero
4849 }
4950
50- let rightAngle : Float = 90.0
51+ let rightAngle : Double = 90.0
5152 let sinRight = sin ( rightAngle. radians)
52- var rise : Float = 0.0
53- var run : Float = 0.0
53+ var rise : Double = 0.0
54+ var run : Double = 0.0
5455 var point : CartesianPoint = . zero
5556
5657 switch clockwise {
@@ -110,9 +111,10 @@ public extension CartesianPoint {
110111 /// * **c**: calculated based on `degree` and `radius`.
111112 /// * **a**: supplied via the `point` (x/y based on closest axis)
112113 ///
113- /// - parameter radius: The straight line distance from the _origin_.
114- /// - parameter degree: The angular degree (0-360), clockwise from the x-axis.
115- /// - parameter modifier: The point used to clip or expand the result. The nearest axis value is used.
114+ /// - parameters:
115+ /// - radius: The straight line distance from the _origin_.
116+ /// - degree: The angular degree (0-360), clockwise from the x-axis.
117+ /// - modifier: The point used to clip or expand the result. The nearest axis value is used.
116118 static func make( for radius: Radius , degree: Degree , modifier: CartesianPoint , clockwise: Bool = true ) throws -> CartesianPoint {
117119 guard degree >= 0.0 , degree <= 360.0 else {
118120 throw GraphPointError . invalidDegree ( degree)
@@ -131,28 +133,28 @@ public extension CartesianPoint {
131133 switch clockwise {
132134 case true :
133135 if ( degree >= 315 ) {
134- point. x = sqrtf ( powf ( radius, 2 ) - powf ( modifier. y, 2 ) )
136+ point. x = sqrt ( pow ( radius, 2 ) - pow ( modifier. y, 2 ) )
135137 point. y = modifier. y
136138 } else if ( degree >= 270 ) {
137139 point. x = modifier. x
138- point. y = sqrtf ( powf ( radius, 2 ) - powf ( modifier. x, 2 ) )
140+ point. y = sqrt ( pow ( radius, 2 ) - pow ( modifier. x, 2 ) )
139141 } else if ( degree >= 225 ) {
140142 point. x = modifier. x
141- point. y = sqrtf ( powf ( radius, 2 ) - powf ( modifier. x, 2 ) )
143+ point. y = sqrt ( pow ( radius, 2 ) - pow ( modifier. x, 2 ) )
142144 } else if ( degree >= 180 ) {
143- point. x = - ( sqrtf ( powf ( radius, 2 ) - powf ( modifier. y, 2 ) ) )
145+ point. x = - ( sqrt ( pow ( radius, 2 ) - pow ( modifier. y, 2 ) ) )
144146 point. y = modifier. y
145147 } else if ( degree >= 135 ) {
146- point. x = - ( sqrtf ( powf ( radius, 2 ) - powf ( modifier. y, 2 ) ) )
148+ point. x = - ( sqrt ( pow ( radius, 2 ) - pow ( modifier. y, 2 ) ) )
147149 point. y = modifier. y
148150 } else if ( degree >= 90 ) {
149151 point. x = modifier. x
150- point. y = - ( sqrtf ( powf ( radius, 2 ) - powf ( modifier. x, 2 ) ) )
152+ point. y = - ( sqrt ( pow ( radius, 2 ) - pow ( modifier. x, 2 ) ) )
151153 } else if ( degree >= 45 ) {
152154 point. x = modifier. x
153- point. y = - ( sqrtf ( powf ( radius, 2 ) - powf ( modifier. x, 2 ) ) )
155+ point. y = - ( sqrt ( pow ( radius, 2 ) - pow ( modifier. x, 2 ) ) )
154156 } else if ( degree >= 0 ) {
155- point. x = sqrtf ( powf ( radius, 2 ) - powf ( modifier. y, 2 ) )
157+ point. x = sqrt ( pow ( radius, 2 ) - pow ( modifier. y, 2 ) )
156158 point. y = modifier. y
157159 }
158160 case false :
0 commit comments