@@ -77,25 +77,25 @@ RotMatrix(x::SMatrix{N,N,T,L}) where {N,T,L} = RotMatrix{N,T,L}(x)
7777Base. zero (:: Type{RotMatrix} ) = error (" The dimension of rotation is not specified." )
7878
7979# These functions (plus size) are enough to satisfy the entire StaticArrays interface:
80- @inline function RotMatrix (t:: NTuple{L} ) where L
81- n = sqrt (L )
80+ @inline function RotMatrix (t:: Tuple )
81+ n = sqrt (length (t) )
8282 if ! isinteger (n)
8383 throw (DimensionMismatch (" The length of input tuple $(t) must be square number." ))
8484 end
8585 N = Int (n)
8686 RotMatrix (SMatrix {N,N} (t))
8787end
88- @inline (:: Type{RotMatrix{N}} )(t:: NTuple ) where N = RotMatrix (SMatrix { N,N} (t))
89- @inline RotMatrix {N,T} (t:: NTuple ) where {N,T} = RotMatrix (SMatrix { N,N,T} (t))
90- @inline RotMatrix {N,T,L} (t:: NTuple{L} ) where {N,T,L} = RotMatrix (SMatrix { N,N,T} (t))
88+ @inline (:: Type{RotMatrix{N}} )(t:: Tuple ) where N = RotMatrix (SArray {Tuple{ N,N} } (t))
89+ @inline RotMatrix {N,T} (t:: Tuple ) where {N,T} = RotMatrix (SArray {Tuple{ N,N} ,T} (t))
90+ @inline RotMatrix {N,T,L} (t:: Tuple ) where {N,T,L} = RotMatrix (SArray {Tuple{ N,N} ,T} (t))
9191
9292# Create aliases RotMatrix2{T} = RotMatrix{2,T,4} and RotMatrix3{T} = RotMatrix{3,T,9}
9393for N = 2 : 3
9494 L = N* N
9595 RotMatrixN = Symbol (:RotMatrix , N)
9696 @eval begin
9797 const $ RotMatrixN{T} = RotMatrix{$ N, T, $ L}
98- @inline $ RotMatrixN (t:: NTuple{$L} ) = RotMatrix (SMatrix { $N,$N} (t))
98+ @inline $ RotMatrixN (t:: Tuple ) = RotMatrix (SArray {Tuple{ $N,$N} } (t))
9999 end
100100end
101101
@@ -152,7 +152,7 @@ params(r::Angle2d) = SVector{1}(r.theta)
152152
153153Angle2d (r:: Rotation{2} ) = Angle2d (rotation_angle (r))
154154Angle2d {T} (r:: Rotation{2} ) where {T} = Angle2d {T} (rotation_angle (r))
155- @inline (:: Type{R} )(t:: NTuple{4} ) where R<: Angle2d = convert (R, RotMatrix (t))
155+ @inline (:: Type{R} )(t:: Tuple ) where R<: Angle2d = convert (R, RotMatrix2 (t))
156156
157157Base. one (:: Type{A} ) where {A<: Angle2d } = A (0 )
158158
0 commit comments