def dot(self, other_tf):
        """Compose this simliarity transform with another.

        This transform is on the left-hand side of the composition.

        Parameters
        ----------
        other_tf : :obj:`SimilarityTransform`
            The other SimilarityTransform to compose with this one.

        Returns
        -------
        :obj:`SimilarityTransform`
            A SimilarityTransform that represents the composition.

        Raises
        ------
        ValueError
            If the to_frame of other_tf is not identical to this transform's
            from_frame.
        """
        if other_tf.to_frame != self.from_frame:
            raise ValueError('To frame of right hand side ({0}) must match from frame of left hand side ({1})'.format(other_tf.to_frame, self.from_frame))
        if not isinstance(other_tf, RigidTransform):
            raise ValueError('Can only compose with other RigidTransform classes')

        other_scale = 1.0
        if isinstance(other_tf, SimilarityTransform):
            other_scale = other_tf.scale

        rotation = self.rotation.dot(other_tf.rotation)
        translation = self.translation + self.scale * self.rotation.dot(other_tf.translation)
        scale = self.scale * other_scale
        return SimilarityTransform(rotation, translation, scale,
                                   from_frame=other_tf.from_frame,
                                   to_frame=self.to_frame)
def dot ( self , other_tf ) : if other_tf . to_frame != self . from_frame : raise ValueError ( 'To frame of right hand side ({0}) must match from frame of left hand side ({1})' . format ( other_tf . to_frame , self . from_frame ) ) if not isinstance ( other_tf , RigidTransform ) : raise ValueError ( 'Can only compose with other RigidTransform classes' ) other_scale = 1.0 if isinstance ( other_tf , SimilarityTransform ) : other_scale = other_tf . scale rotation = self . rotation . dot ( other_tf . rotation ) translation = self . translation + self . scale * self . rotation . dot ( other_tf . translation ) scale = self . scale * other_scale return SimilarityTransform ( rotation , translation , scale , from_frame = other_tf . from_frame , to_frame = self . to_frame )
Compose this simliarity transform with another.

        This transform is on the left-hand side of the composition.

        Parameters
        ----------
        other_tf : :obj:`SimilarityTransform`
            The other SimilarityTransform to compose with this one.

        Returns
        -------
        :obj:`SimilarityTransform`
            A SimilarityTransform that represents the composition.

        Raises
        ------
        ValueError
            If the to_frame of other_tf is not identical to this transform's
            from_frame.