I’m trying to transform from a Spherical type to an SVector using the CartersianFromSpherical() function, but I get the following error:
julia> CartesianFromSpherical(S)
ERROR: MethodError: Cannot `convert` an object of type CoordinateTransformations.Spherical{Float64} to an object of type Coo
rdinateTransformations.CartesianFromSpherical
This may have arisen from a call to the constructor CoordinateTransformations.CartesianFromSpherical(...),
since type constructors fall back to convert methods.
Stacktrace:
[1] CoordinateTransformations.CartesianFromSpherical(::CoordinateTransformations.Spherical{Float64}) at .\sysimg.jl:24
I take it I’m not calling the function correctly? Paging @andyferris?
Many transformations have parameters, like the angle of a rotation or the distance of a translation, so it makes sense to construct them like r = RotX(0.2) and then use r(p). Transformations without parameters are just treated the same way (presumably for consistency of the API).
Yeah, that’s right. Arguably one could export a const cartesianfromspherical = CartesianFromSpherical() function (transformation) from CoordianteTransformations, but it didn’t seem that worth it.
Also maybe worth keeping in mind that the spherical/Cartesian/cylindrical stuff was simply a prototype for myself to prove that the method (manipulations on transformations, using composition and inverse, etc) would actually work. To me the useful stuff are the Affine transformations, camera transformations, the transformations in Geodesy.jl, image transformations, and so-on.