Recent Changes - Search:

Information

Installation

Documentation

User Feedback

About Transforms

2D Transformations
 An object of the class java.awt.geom.AffineTransform. EJS will accept a constant or variable of type double or int and will convert it into a rotation (which is an AffineTransform) with that angle in degrees (for an int) or radians (for a double). If you provide a double[] array with six entries, EJS will create an AffineTransform through a call to new java.awt.geom.AffineTransform (m[0],m[1],m[2],m[3],m[4],m[5]). FInally, EJS also converts some Strings into appropriated transformation. To see the format accepted, we recommend that you use the transformation editor provided. You can easily guess the meaning of the coded strings formed by this editor.

 

3D Transformations
Esentially all transform is composed by several traslations and turns. Traslations can be made changing the element position (its geometric center position).

 

There are three different ways to make a turn. The first one is to turn the element around one axis. This axis can be one of the main axis, X,Y,Z or another one you choose. In the number field you select the angle you want to turn by the element in radians or degrees. The second way is to align one known vector with an other one. And finally, the third way with a quaternion rotation. In all them you can see EJS translate our choices in a string variable.

 

If we want to make a dinamic transform we will need concatenate this string variables. For example, if I want to turn the element around the Z axis and change the angle used with a previously defined variable ang. Then we have to type in the bottom field “z:”+ang. EJS will use then the JAVA property to concatenate the two strings.

 

Advanced users can build more complex transforms with the JAVA class org.opensourcephisics.numerics.Trasformation.

 

 

 

Edit - History - Print - Recent Changes - Search
Page last modified on April 29, 2009, at 12:11 AM