@@ -24,7 +24,7 @@ Base.show(io::IO, trans::CartesianFromPolar) = print(io, "CartesianFromPolar()")
24
24
function (:: PolarFromCartesian )(x:: AbstractVector )
25
25
length (x) == 2 || error (" Polar transform takes a 2D coordinate" )
26
26
27
- Polar (sqrt (x[1 ]* x[1 ] + x[2 ]* x[2 ]), atan2 (x[2 ], x[1 ]))
27
+ Polar (sqrt (x[1 ]* x[1 ] + x[2 ]* x[2 ]), atan (x[2 ], x[1 ]))
28
28
end
29
29
30
30
function transform_deriv (:: PolarFromCartesian , x:: AbstractVector )
@@ -114,7 +114,7 @@ Base.show(io::IO, trans::SphericalFromCylindrical) = print(io, "SphericalFromCyl
114
114
function (:: SphericalFromCartesian )(x:: AbstractVector )
115
115
length (x) == 3 || error (" Spherical transform takes a 3D coordinate" )
116
116
117
- Spherical (sqrt (x[1 ]* x[1 ] + x[2 ]* x[2 ] + x[3 ]* x[3 ]), atan2 (x[2 ],x[1 ]), atan (x[3 ]/ sqrt (x[1 ]* x[1 ] + x[2 ]* x[2 ])))
117
+ Spherical (sqrt (x[1 ]* x[1 ] + x[2 ]* x[2 ] + x[3 ]* x[3 ]), atan (x[2 ],x[1 ]), atan (x[3 ]/ sqrt (x[1 ]* x[1 ] + x[2 ]* x[2 ])))
118
118
end
119
119
function transform_deriv (:: SphericalFromCartesian , x:: AbstractVector )
120
120
length (x) == 3 || error (" Spherical transform takes a 3D coordinate" )
@@ -151,7 +151,7 @@ transform_deriv_params(::CartesianFromSpherical, x::Spherical) = error("Cartesia
151
151
function (:: CylindricalFromCartesian )(x:: AbstractVector )
152
152
length (x) == 3 || error (" Cylindrical transform takes a 3D coordinate" )
153
153
154
- Cylindrical (sqrt (x[1 ]* x[1 ] + x[2 ]* x[2 ]), atan2 (x[2 ],x[1 ]), x[3 ])
154
+ Cylindrical (sqrt (x[1 ]* x[1 ] + x[2 ]* x[2 ]), atan (x[2 ],x[1 ]), x[3 ])
155
155
end
156
156
157
157
function transform_deriv (:: CylindricalFromCartesian , x:: AbstractVector )
0 commit comments