org.opensourcephysics.displayejs.utils
Class TransformationComposition

java.lang.Object
  extended by org.opensourcephysics.displayejs.utils.TransformationComposition
All Implemented Interfaces:
java.lang.Cloneable, Transformation

public class TransformationComposition
extends java.lang.Object
implements Transformation

Title: TransformationComposition

Description: A composition of two transformations.

Copyright: Copyright (c) Esquembre Jan 2004

Company: Universidad de Murcia

Version:
1.0
Author:
Francisco Esquembre (fem@um.es)

Constructor Summary
TransformationComposition(Transformation first, Transformation second)
          Creates a transformation made of two other transformations
 
Method Summary
 java.lang.Object clone()
          Provides a copy of this transformation.
 double[] direct(double[] input)
          Transforms a given point
 double[] inverse(double[] input)
          The inverse transformation (if it exists).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransformationComposition

public TransformationComposition(Transformation first,
                                 Transformation second)
Creates a transformation made of two other transformations

Parameters:
first - The first transformation
second - The second transformation
Method Detail

clone

public java.lang.Object clone()
Description copied from interface: Transformation
Provides a copy of this transformation. This is used by an OSP 3D Element that will explicitely get a clone of it whenever its setTransformation() method is invoked. Thus, changing the original transformation directly has no effect unless a new setTransformation is invoked.

Specified by:
clone in interface Transformation
Overrides:
clone in class java.lang.Object

direct

public double[] direct(double[] input)
Description copied from interface: Transformation
Transforms a given point

Specified by:
direct in interface Transformation
Parameters:
input - double[] the coordinates to be transformed (the array's contents will be changed accordingly)
Returns:
double[] the transformed vector (i.e. point)

inverse

public double[] inverse(double[] input)
Description copied from interface: Transformation
The inverse transformation (if it exists). If the transformation is not invertible, then a call to this method must throw a UnsupportedOperationException exception.

Specified by:
inverse in interface Transformation
Parameters:
input - double[] the coordinates to be transformed (the array's contents will be changed accordingly)
Returns:
double[] the transformed vector (i.e. point)