Skip to content

Commit e7e0132

Browse files
committed
atan2(y, x) -> atan(y, x)
1 parent dea3467 commit e7e0132

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

REQUIRE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
julia 0.6
22
StaticArrays
33
Rotations 0.3.0
4-
Compat 0.33
4+
Compat 0.69

src/coordinatesystems.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Base.show(io::IO, trans::CartesianFromPolar) = print(io, "CartesianFromPolar()")
2424
function (::PolarFromCartesian)(x::AbstractVector)
2525
length(x) == 2 || error("Polar transform takes a 2D coordinate")
2626

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]))
2828
end
2929

3030
function transform_deriv(::PolarFromCartesian, x::AbstractVector)
@@ -114,7 +114,7 @@ Base.show(io::IO, trans::SphericalFromCylindrical) = print(io, "SphericalFromCyl
114114
function (::SphericalFromCartesian)(x::AbstractVector)
115115
length(x) == 3 || error("Spherical transform takes a 3D coordinate")
116116

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])))
118118
end
119119
function transform_deriv(::SphericalFromCartesian, x::AbstractVector)
120120
length(x) == 3 || error("Spherical transform takes a 3D coordinate")
@@ -151,7 +151,7 @@ transform_deriv_params(::CartesianFromSpherical, x::Spherical) = error("Cartesia
151151
function (::CylindricalFromCartesian)(x::AbstractVector)
152152
length(x) == 3 || error("Cylindrical transform takes a 3D coordinate")
153153

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])
155155
end
156156

157157
function transform_deriv(::CylindricalFromCartesian, x::AbstractVector)

0 commit comments

Comments
 (0)