Rotate

(Engine-Level Function)

Description: Returns a Rotate value, which specifies a rotation about a point.
Returns: Rotate
Usage: Steady State only.
Function Groups: Graphics
Related to: Normalize | Point | Trajectory | Vertex
Format: Rotate(Amount, MinDegrees, MaxDegrees, Center)
Parameters:  
Amount
Required. Any expression that returns a Normalize value, specifying how much to rotate.
MinDegrees
Required. Any numeric expression giving the minimum amount of rotation, in degrees. This is not a limit on the amount of rotation.
MaxDegrees
Required. Any numeric expression giving the maximum amount of rotation, in degrees. This is not a limit on the amount of rotation.
Center
Required. Any expression that returns a Point. This is the center point for the rotation.
Comments: The return value is a Rotate value, which specifies how to rotate about a point. It has a Normalize value, two angles corresponding to the low and high limits of the Normalize value, and a Point value which specifies the center of rotation. A Rotate value may be used in any layered graphics statement to make the statement rotate.

Example:

armRot = Rotate(Normalize(armEncoderPosition, 0, 100)
               { Amount of rotation },
               45 { Minimum rotation, in degrees },
               135 { Maximum rotation, in degrees },
               Point(50, 75, Invalid, Invalid)
               { Center point for rotation });

This specifies a rotation about the point (50, 75). If armEncoderPosition is 0, any object that uses this Rotate will rotate 45 degrees counter-clockwise about the point (50, 75). If armEncoderPosition is 100, any object that uses this Rotate will rotate 135 degrees counter-clockwise about the point (50, 75). If armEncoderPosition is any other value, the rotation will be by a proportional amount, not limited to the range 45 to 135 degrees.