Class Rotate

java.lang.Object
javafx.scene.transform.Transform
javafx.scene.transform.Rotate
All Implemented Interfaces:
Cloneable, EventTarget

public class Rotate extends Transform
This class represents an Affine object that rotates coordinates around an anchor point. This operation is equivalent to translating the coordinates so that the anchor point is at the origin (S1), then rotating them about the new origin (S2), and finally translating so that the intermediate origin is restored to the coordinates of the original anchor point (S3).

The matrix representing the rotation transformation around an axis (x,y,z) by an angle t is as follows:

              [   cos(t)   -sin(t)   0   x-x*cos(t)+y*sin(t)   ]
              [   sin(t)    cos(t)   0   y-x*sin(t)-y*cos(t)   ]
              [     0         0      1           z             ]
 

For example, to rotate a text 30 degrees around the Z-axis at anchor point of (50,30):


 Text text = new Text("This is a test");
 text.setX(10);
 text.setY(50);
 text.setFont(new Font(20));

 text.getTransforms().add(new Rotate(30, 50, 30));
 
Since:
JavaFX 2.0