Statics Methods Relevant to Transform2Bvr Objects

compose Creates a two-dimensional transformation behavior that is a composition of the given transformation behaviors.
compose2Array Creates a two-dimensional transformation behavior that is a composition of the Transform2Bvr objects included in the array.
followPath Creates a Transform2Bvr object that is a translation (from the origin) that follows a 2-D vector drawing path.
followPathAngle Creates a Transform2Bvr object that is equal to the angle of the path's tangent while it is being traversed, translated by its position. This is equivalent to rotating the position by its derivative.
followPathAngleUpright Creates a Transform2Bvr object that is equal to the angle of the path's tangent while it is being traversed, translated by its position. This is equivalent to rotating the position by its derivative, except that the angle that is perpendicular to the X-axis (in local coordinates) will always be less than 180 degrees.
rotate Creates a two-dimensional transformation behavior that, when applied to any two-dimensional object, rotates it by the given angle (expressed in radians).
rotateDegrees Creates a two-dimensional transformation behavior that, when applied to any two-dimensional object, rotates it by the given angle (expressed in degrees).
rotateRate Creates a two-dimensional transformation behavior that, when applied to any two-dimensional object, rotates it by the given angle (expressed in radians).
rotateRateDegrees Creates a two-dimensional transformation behavior that, when applied to any two-dimensional object, rotates it by the given angle (expressed in degrees).
scale(sx, sy) Creates a two-dimensional transformation behavior that, when applied to any two-dimensional object, scales it. Scaling is specified as two integers.
scale(v) Creates a two-dimensional transformation behavior that, when applied to any two-dimensional object, scales it. The scaling is specified as a Vector2Bvr object.
scaleRate Creates a two-dimensional transformation behavior that, when applied to any two-dimensional object, scales it. The scaling rates are determined by multiplying each argument by localTime.
scale2 Creates a two-dimensional transformation behavior that applies a uniform scale to every coordinate of a two-dimensional object.
scale2Rate Creates a two-dimensional transformation behavior that applies a uniform scale to every coordinate of a two-dimensional object. The scaling rate is determined by multiplying the argument by localTime.
transform3x2 Creates a two-dimensional transformation behavior that consists of a 3 by 2 matrix having the values specified by the given number behaviors.
translate(tx, ty) Creates a two-dimensional transformation behavior that, when applied to a point behavior, translates (moves) the point by the amount given by the number behaviors.
translate(loc) Creates a two-dimensional transformation that, when applied to a point, translates (moves) the point to the new location loc.
translate(v) Creates a two-dimensional transformation behavior that when applied to a point behavior translates (moves) the point by the amount given by the vector behavior.
translateRate Creates a two-dimensional transformation behavior that, when applied to a point, translates (moves) the point by the amount given by the arguments.
xShear Creates a two-dimensional transformation behavior that shears the x-axis either up or down.
xShearRate Creates a two-dimensional transformation behavior that shears the x-axis either up or down. The shear rate is determined by multiplying the argument by localTime.
yShear Creates a two-dimensional transformation behavior that shears the y-axis either left or right.
yShearRate Creates a two-dimensional transformation behavior that shears the y-axis either left or right. The shear rate is determined by multiplying the argument by localTime.

compose

Statics Class

Creates a two-dimensional transformation behavior that is a composition of the given transformation behaviors.

Syntax

public static Transform2Bvr compose( Transform2Bvr xf1, Transform2Bvr xf2 );

Parameters

xf1 and xf2
Transform2Bvr objects.

Return Value

Returns the Transform2Bvr object.

Remarks

Composing a transform is equivalent to first applying xf2 and then applying xf1. In other words:

im.transform(compose(xf1, xf2)
== im.transform(xf2).transform(xf1)

compose2Array

Statics Class

Creates a two-dimensional transformation behavior that is a composition of the Transform2Bvr objects included in the array.

Syntax

public static Transform2Bvr compose2Array( Transform2Bvr[] xforms );

Parameters

xforms
Transform2Bvr objects.

Return Value

Returns the Transform2Bvr object.

Remarks

Composing a transform is equivalent to first applying the nth transform, then applying the (nth-1) transform, and so on.

followPath

Statics Class

Creates a Transform2Bvr object that is a translation (from the origin) that follows a 2-D vector drawing path. The Path2Bvr object is converted into the equivalent translation transform.

Syntax

public static Transform2Bvr followPath( Path2Bvr path, NumberBvr evaluator );

Parameters

path
Path2Bvr object that will be traced.
evaluator
NumberBvr object representing an evaluator with a value in the range [0, 1]. This value is equivalent to a position on the path, where 0 is the beginning of the path and 1 is the end. This parameter can also be of type double. If it is, then the parameter is treated as a duration, representing the amount of time it will take (in seconds) to trace the entire path.

Return Value

Returns the Transform2Bvr object.

followPathAngle

Statics Class

Creates a Transform2Bvr object that is equal to the angle of the path's tangent while it is being traversed, translated by its position. This is equivalent to rotating the position by its derivative.

Syntax

public static Transform2Bvr followPathAngle( Path2Bvr path, NumberBvr evaluator );

Parameters

path
Path2Bvr object this is traversed.
evaluator
NumberBvr object representing an evaluator with a value in the range [0, 1]. This value is equivalent to a position on the path, where 0 is the beginning of the path and 1 is the end. This parameter can also be of type double. If it is, then the parameter is treated as a duration, representing the amount of time it will take (in seconds) to trace the entire path.

Return Value

Returns the Transform2Bvr object.

followPathAngleUpright

Statics Class

Creates a Transform2Bvr object that is equal to the angle of the path's tangent while it is being traversed, translated by its position. This is equivalent to rotating the position by its derivative, except that the angle that is perpendicular to the X-axis (in local coordinates) will always be less than 180 degrees.

Syntax

public static Transform2Bvr followPathAngleUpright( Path2Bvr path, NumberBvr evaluator );

Parameters

path
Path2Bvr object that is traversed.
evaluator
NumberBvr object representing an evaluator with a value in the range [0, 1]. This value is equivalent to a position on the path, where 0 is the beginning of the path and 1 is the end. This parameter can also be of type double. If it is, then the parameter is treated as a duration, representing the amount of time it will take (in seconds) to trace the entire path.

Return Value

Returns the Transform2Bvr object.

rotate

Statics Class

Creates a two-dimensional transformation behavior that, when applied to any two-dimensional object, rotates it by the given angle (expressed in radians).

Syntax

public static Transform2Bvr rotate( NumberBvr radians );

Parameters

radians
NumberBvr object representing the angle of rotation. This parameter can also be of type double.

Return Value

Returns the Transform2Bvr object.

Remarks

Rotations are counter-clockwise.

rotateDegrees

Statics Class

Creates a two-dimensional transformation behavior that, when applied to any two-dimensional object, rotates it by the given angle (expressed in degrees).

Syntax

public static Transform2Bvr rotateDegrees( double degrees );

Parameters

degrees
The double representing the angle of rotation (expressed in degrees).

Return Value

Returns the Transform2Bvr object.

Remarks

Rotations are counter-clockwise.

rotateRate

Statics Class

Creates a two-dimensional transformation behavior that, when applied to any two-dimensional object, rotates it by the given angle (expressed in radians). This value is multiplied by localTime to determine the rotation rate.

Syntax

public static Transform2Bvr rotateRate( double radians );

Parameters

radians
The double value representing the angle of rotation, multiplied by localTime. The unit is radians per second.

Return Value

Returns the Transform2Bvr object.

Remarks

Rotations are counter-clockwise.

rotateRateDegrees

Statics Class

Creates a two-dimensional transformation behavior that, when applied to any two-dimensional object, rotates it by the given angle (expressed in degrees). This value is multiplied by localTime to determine the rotation rate.

Syntax

public static Transform2Bvr rotateRateDegrees( double degrees );

Parameters

degrees
The double value representing the angle of rotation, multiplied by localTime. The unit is degrees per second.

Return Value

Returns the Transform2Bvr object.

Remarks

Rotations are counter-clockwise.

scale(sx, sy)

Statics Class

Creates a two-dimensional transformation behavior that, when applied to any two-dimensional object, scales it. For example, the transformation modifies the length of a vector by multiplying the vector's coordinates by the values of the corresponding number behaviors. The scaling is specified as two integers, one for scaling along the x dimension and one for scaling along the y dimension.

Syntax

public static Transform2Bvr scale( NumberBvr sx, NumberBvr sy );

Parameters

sx and sy
NumberBvr objects representing the amount to scale. The value of sx applies to the x coordinate, and sy to the y coordinate. These parameters can also be of type double.

Return Value

Returns the Transform2Bvr object.

scale(v)

Statics Class

Creates a two-dimensional transformation behavior that, when applied to any two-dimensional object, scales it. For example, the transformation modifies the location of a point by multiplying the point's coordinates by the values of the corresponding vector coordinates. The scaling is specified as a Vector2Bvr object.

Syntax

public static Transform2Bvr scale( Vector2Bvr v );

Parameters

v
Vector2Bvr object. The x and y coordinates of the vector behavior specify the amount to scale the x and y coordinates, respectively.

Return Value

Returns the Transform2Bvr object.

scaleRate

Statics Class

Creates a two-dimensional transformation behavior that, when applied to any two-dimensional object, scales it. The scaling rates are determined by multiplying each argument by localTime.

Syntax

public static Transform2Bvr scaleRate( double x, double y );

Parameters

sx and sy
The doubles representing the amounts to scale. The value of sx applies to the x coordinate, and sy to the y coordinate.

Return Value

Returns the Transform2Bvr object.

scale2

Statics Class

Creates a two-dimensional transformation behavior that applies a uniform scale to every coordinate of a two-dimensional object.

Syntax

public static Transform2Bvr scale2( NumberBvr uniformFactor );

Parameters

uniformFactor
NumberBvr object representing the value to apply to both the x and y coordinates, respectively. This parameter can also be of type double.

Return Value

Returns the Transform2Bvr object.

See Also

scale, scale

scale2Rate

Statics Class

Creates a two-dimensional transformation behavior that applies a uniform scale to every coordinate of a two-dimensional object. The scaling rate is determined by multiplying the argument by localTime.

Syntax

public static Transform2Bvr scale2Rate( double rate );

Parameters

rate
The double representing the value to apply to both the x and y coordinates, respectively.

Return Value

Returns the Transform2Bvr object.

transform3x2

Statics Class

Creates a two-dimensional transformation behavior that consists of a 3 by 2 matrix having the values specified by the given number behaviors.

Syntax

public static Transform2Bvr transform3x2( NumberBvr[] matrix );

Parameters

matrix
A 3 by 2 matrix. The top row of the matrix could be represented as containing NumberBvr objects a00, a01, and a02. Use a00 to scale the x coordinate and a02 to translate x.
Bottom row of the matrix could be represented as containing the NumberBvr objects a10, a11, and a12. Use a11 to scale the y coordinate and a12 to translate y.

Return Value

Returns the Transform2Bvr object.

Remarks

The X and Y translation components are given by a02 and a12, respectively.

translate(tx, ty)

Statics Class

Creates a two-dimensional transformation behavior that, when applied to a point behavior, translates (moves) the point by the amount given by the number behaviors.

Syntax

public static Transform2Bvr translate( NumberBvr tx, NumberBvr ty );

Parameters

tx and ty
NumberBvr objects representing the amount to translate the point along the x and y axes, respectively. These parameters can also be of type double.

Return Value

Returns the Transform2Bvr object.

Remarks

Two-dimensional vectors are unchanged by translations.

translate(loc)

Statics Class

Creates a two-dimensional transformation that, when applied to a point, translates (moves) the point to the new location loc.

Syntax

public static Transform2Bvr translate( Point2Bvr loc );

Parameters

loc
Point2Bvr object specifying the new location.

Return Value

Returns the Transform2Bvr object.

translate(v)

Statics Class

Creates a two-dimensional transformation behavior that when applied to a point behavior translates (moves) the point by the amount given by the vector behavior.

Syntax

public static Transform2Bvr translate( Vector2Bvr v );

Parameters

v
Vector2Bvr object. The x and y coordinates of the vector behavior specify the amount to translate along the x and y axes, respectively.

Return Value

Returns the Transform2Bvr object.

Remarks

Two-dimensional vectors are unchanged by translations.

translateRate

Statics Class

Creates a two-dimensional transformation behavior that, when applied to a point, translates (moves) the point by the amount given by the arguments. The translation rates are determined by multiplying the arguments by localTime.

Syntax

public static Transform2Bvr translateRate( double x, double y );

Parameters

x and y
The doubles representing the amounts to translate the point along the X and Y axes, respectively.

Return Value

Returns the Transform2Bvr object.

Remarks

Two-dimensional vectors are unchanged by translations.

xShear

Statics Class

Creates a two-dimensional transformation behavior that shears the x-axis either up or down. This means the X-coordinate of the points remains unchanged, and the Y-coordinate increases by the product of the X-coordinate and the shear factor. In other words, X2 = X1, and Y2 = Y1 + aX1, where a is the shear factor.

Syntax

public static Transform2Bvr xShear( NumberBvr x );

Parameters

x
NumberBvr object representing the amount to shear. This parameter can also be of type double.

Return Value

Returns the Transform2Bvr object.

See Also

yShear

xShearRate

Statics Class

Creates a two-dimensional transformation behavior that shears the x-axis either up or down. The shear rate is determined by multiplying the argument by localTime.

Syntax

public static Transform2Bvr xShearRate( double rate );

Parameters

rate
The double value representing the amount to shear, multiplied by localTime. The unit is meters per second.

Return Value

Returns the Transform2Bvr object.

yShear

Statics Class

Creates a two-dimensional transformation behavior that shears the y-axis either left or right. This means the Y-coordinate of the points remains unchanged, and the X-coordinate increases by the product of the Y-coordinate and the shear factor. In other words, Y2 = Y1 and X2 = X1 + aY1, where a is the shear factor.

Syntax

public static Transform2Bvr yShear( NumberBvr y );

Parameters

y
NumberBvr object representing the amount to shear. This parameter can also be of type double.

Return Value

Returns the Transform2Bvr object.

See Also

xShear

yShearRate

Statics Class

Creates a two-dimensional transformation behavior that shears the y-axis either left or right. The shear rate is determined by multiplying the argument by localTime.

Syntax

public static Transform2Bvr yShearRate( double rate );

Parameters

rate
The double value representing the amount to shear the y-axis, multiplied by localTime. The unit is meters per second.

Return Value

Returns the Transform2Bvr object.


Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.