@@ -77,25 +77,25 @@ RotMatrix(x::SMatrix{N,N,T,L}) where {N,T,L} = RotMatrix{N,T,L}(x)
77
77
Base. zero (:: Type{RotMatrix} ) = error (" The dimension of rotation is not specified." )
78
78
79
79
# 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) )
82
82
if ! isinteger (n)
83
83
throw (DimensionMismatch (" The length of input tuple $(t) must be square number." ))
84
84
end
85
85
N = Int (n)
86
86
RotMatrix (SMatrix {N,N} (t))
87
87
end
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))
91
91
92
92
# Create aliases RotMatrix2{T} = RotMatrix{2,T,4} and RotMatrix3{T} = RotMatrix{3,T,9}
93
93
for N = 2 : 3
94
94
L = N* N
95
95
RotMatrixN = Symbol (:RotMatrix , N)
96
96
@eval begin
97
97
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))
99
99
end
100
100
end
101
101
@@ -152,7 +152,7 @@ params(r::Angle2d) = SVector{1}(r.theta)
152
152
153
153
Angle2d (r:: Rotation{2} ) = Angle2d (rotation_angle (r))
154
154
Angle2d {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))
156
156
157
157
Base. one (:: Type{A} ) where {A<: Angle2d } = A (0 )
158
158
0 commit comments