-
Notifications
You must be signed in to change notification settings - Fork 14
A minor issue on ACE.SphericalHarmonics:cart2spher #137
Copy link
Copy link
Open
Description
If the input of cart2spher is evaluate. Can we map Cartesian
e.g., change it to
function cart2spher(R::AbstractVector)
@assert length(R) == 3
r = norm(R)
if r == 0
return SphericalCoords(0.0, 1.0, 0.0, 1.0, 0.0)
end
φ = atan(R[2], R[1])
sinφ, cosφ = sincos(φ)
cosθ = R[3] / r
sinθ = sqrt(R[1]^2+R[2]^2) / r
return SphericalCoords(r, cosφ, sinφ, cosθ, sinθ)
end
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels