@@ -39,7 +39,7 @@ function Base.inv(trans::AbstractAffineTransformation)
39
39
AffineTransformation (Minv, - Minv * translation_vector (trans))
40
40
end
41
41
42
- function Base. isapprox (t1:: AbstractAffineTransformation , t2:: AbstractAffineTransformation , kwargs... )
42
+ function Base. isapprox (t1:: AbstractAffineTransformation , t2:: AbstractAffineTransformation ; kwargs... )
43
43
isapprox (transformation_matrix (t1), transformation_matrix (t2); kwargs... ) &&
44
44
isapprox (translation_vector (t1), translation_vector (t2); kwargs... )
45
45
end
84
84
85
85
# transform_deriv() identical to that provided by AbstractAffineTransformation
86
86
87
- function Base. isapprox (t1:: AbstractLinearTransformation , t2:: AbstractLinearTransformation , kwargs... )
87
+ function Base. isapprox (t1:: AbstractLinearTransformation , t2:: AbstractLinearTransformation ; kwargs... )
88
88
isapprox (transformation_matrix (t1), transformation_matrix (t2); kwargs... )
89
89
end
90
90
91
91
# These functions are remove any reference to unnecessary calls to
92
92
# translation_vector(::LinearTransformation) from the AbstractAffineTransformations
93
93
# interface:
94
94
95
- function Base. isapprox (t1:: AbstractAffineTransformation , t2:: AbstractLinearTransformation , kwargs... )
95
+ function Base. isapprox (t1:: AbstractAffineTransformation , t2:: AbstractLinearTransformation ; kwargs... )
96
96
isapprox (transformation_matrix (t1), transformation_matrix (t2); kwargs... ) &&
97
97
isapprox (norm (translation_vector (t1)), 0 ; kwargs... )
98
98
end
99
99
100
- function Base. isapprox (t1:: AbstractLinearTransformation , t2:: AbstractAffineTransformation , kwargs... )
100
+ function Base. isapprox (t1:: AbstractLinearTransformation , t2:: AbstractAffineTransformation ; kwargs... )
101
101
isapprox (transformation_matrix (t1), transformation_matrix (t2); kwargs... ) &&
102
102
isapprox (norm (translation_vector (t2)), 0 ; kwargs... )
103
103
end
104
104
105
- #=
106
- """
107
- abstract AbstractRotation <: AbstractLinearTransformation
108
-
109
- Provides an interface for implementing rotations of Cartesian coordinates. To
110
- implement an AbstractRotation, you must define
111
-
112
- transformation_matrix(trans)
113
-
114
- where the resulting transformation is (equivalent to)
115
-
116
- trans(x) -> transformation_matrix(trans) * x
117
-
118
- Specific implementations may provide equivalent specializations of `call`, etc,
119
- for optimization purposes. The major difference with AbstractLinearTransformation
120
- is that the matrix is assumed to be orthogonal/unitary for the purpose of
121
- inverting the transformation.
122
-
123
- (See also Rotation, AxisRotation, AbstractLinearTransformation)
124
- """
125
- abstract AbstractRotation <: AbstractLinearTransformation
126
-
127
- transformation_matrix(trans::AbstractRotation) = error("AbstractRotation $(typeof(trans)) must implement transformation_matrix()")
128
- =#
129
-
130
105
131
106
"""
132
107
abstract AbstractTranslation <: AbstractAffineTransformation
@@ -332,11 +307,6 @@ function transformation_matrix(trans::Rotation2D)
332
307
trans. sin trans. cos ]
333
308
end
334
309
335
- function transformation_matrix (trans:: Rotation2D )
336
- @fsa [ trans. cos - trans. sin;
337
- trans. sin trans. cos ]
338
- end
339
-
340
310
function transform_deriv {T} (trans:: Rotation2D , x:: Polar{T} )
341
311
@fsa [ zero (T) zero (T);
342
312
zero (T) one (T) ]
@@ -348,6 +318,7 @@ function transform_deriv_params(trans::Rotation2D, x)
348
318
trans. cos* x[1 ] - trans. sin* x[2 ] )
349
319
end
350
320
321
+ # I don't think this will work in my new vision for rotations...
351
322
function transform_deriv_params {T} (trans:: Rotation2D , x:: Polar{T} )
352
323
@fsa [ zero (T);
353
324
one (T) ]
617
588
- trans. sin Z trans. cos] * x
618
589
end
619
590
620
- function transform_deriv (trans:: RotationXY , x)
621
- Z = zero (trans. cos)
622
- I = one (trans. cos)
623
- @fsa [ trans. cos - trans. sin Z;
624
- trans. sin trans. cos Z;
625
- Z Z I]
626
- end
627
591
function transformation_matrix (trans:: RotationXY )
628
592
Z = zero (trans. cos)
629
593
I = one (trans. cos)
@@ -632,13 +596,6 @@ function transformation_matrix(trans::RotationXY)
632
596
Z Z I]
633
597
end
634
598
635
- function transform_deriv (trans:: RotationYZ , x)
636
- Z = zero (trans. cos)
637
- I = one (trans. cos)
638
- @fsa [ I Z Z;
639
- Z trans. cos - trans. sin;
640
- Z trans. sin trans. cos ]
641
- end
642
599
function transformation_matrix (trans:: RotationYZ )
643
600
Z = zero (trans. cos)
644
601
I = one (trans. cos)
@@ -647,13 +604,6 @@ function transformation_matrix(trans::RotationYZ)
647
604
Z trans. sin trans. cos ]
648
605
end
649
606
650
- function transform_deriv (trans:: RotationZX , x)
651
- Z = zero (trans. cos)
652
- I = one (trans. cos)
653
- @fsa [ trans. cos Z trans. sin;
654
- Z I Z ;
655
- - trans. sin Z trans. cos ]
656
- end
657
607
function transformation_matrix (trans:: RotationZX )
658
608
Z = zero (trans. cos)
659
609
I = one (trans. cos)
0 commit comments