Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected output types from inv(transform)(x) #81

Open
jonalm opened this issue Jun 2, 2022 · 0 comments
Open

Unexpected output types from inv(transform)(x) #81

jonalm opened this issue Jun 2, 2022 · 0 comments

Comments

@jonalm
Copy link

jonalm commented Jun 2, 2022

Consider the following

using CoordinateTransformations
using GeometryBasics
using LinearAlgebra
using Rotations

# define transformations
s = LinearMap(Diagonal(Vec3f(1,1,2)))
r = LinearMap(RotX(0.5f0 * π))
t = Translation(Vec3f(0,1,0))
srt = t  r  s

# vector to be transformed
p = Vec3f(1,2,3)

# display type of transformation output
@show typeof(s(p))
@show typeof(r(p))
@show typeof(t(p))
@show typeof(srt(p))
@show typeof(inv(s)(p))
@show typeof(inv(r)(p))
@show typeof(inv(t)(p))
@show typeof(inv(srt)(p))

I was expecting that the output types of all transformations above would be Vec{3, Float32}, but for the inverse transformations I see multiple different output types.

typeof(s(p)) = Vec{3, Float32}
typeof(r(p)) = Vec{3, Float32}
typeof(t(p)) = Vec{3, Float32}
typeof(srt(p)) = Vec{3, Float32}
typeof((inv(s))(p)) = StaticArrays.MVector{3, Float32}
typeof((inv(r))(p)) = Vec{3, Float32}
typeof((inv(t))(p)) = Vec{3, Float32}
typeof((inv(srt))(p)) = Vector{Float32}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant