Skip to content

Commit 2ee6150

Browse files
authored
Merge pull request #40 from slmcbane/juliav0.7-fixes
Use Compat.atan instead of atan2
2 parents 1fa303c + b464d31 commit 2ee6150

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/CoordinateTransformations.jl

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ __precompile__()
33
module CoordinateTransformations
44

55
using StaticArrays
6-
using Compat: LinearAlgebra, atan2
6+
using Compat.LinearAlgebra
7+
using Compat
78

89
using Rotations
910
export RotMatrix, Quat, SpQuat, AngleAxis, RodriguesVec,

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)