Index Topic Contents | |||
Previous Topic: DAUserData Class Next Topic: DAVector3 Class |
DAVector2 Class
Creates a Vector2 object. At any given time, the value of the object is a direction and length (magnitude), specified as a pair of coordinate values given as either Cartesian coordinates (x, y) or polar coordinates (XYangle, YZangle). The direction of the vector is parallel to the ray that starts at the origin and passes through the point specified by the vector's coordinates, and the length is the distance between the origin and the point.
Because coordinate values are animated numbers (DANumber objects), the direction and length of the Vector2 object can change over time as the values of the animated numbers change.
This class inherits from the DABehavior Class.
- DAVector2 Functions
- DAVector2 Properties
- Relevant Functions from the DAStatics Class
- Relevant Properties from the DAStatics Class
DAVector2 Functions
DAVector2 Class
DivAnimCreates a new two-dimensional DAVector2 object that points in the same direction as the original vector but has a length that has been divided by scalar.
vector2Obj.DivAnim(
scalar
)Parameters
- scalar
- A DANumber object used as the divider. This must be an animated number.
Return Values
Returns the DAVector2 object.
See Also
DivSame as DivAnim except that scalar is a non-animated number (a double).
vector2Obj.Div(
scalar
)
MulAnimCreates a DAVector2 object that points in the same direction as the original vector but has a length that has been multiplied by scalar.
vector2Obj.MulAnim(
scalar
)Parameters
- scalar
- A DANumber object used as the multiplier. This must be an animated number.
Return Values
Returns the DAVector2 object.
See Also
MulSame as MulAnim except that scalar is a non-animated number (a double).
vector2Obj.Mul(
scalar
)
NormalizeCreates a normalized, two-dimensional DAVector2 object. The normalized vector has the same direction as the original vector, but the length is 1.
vector2Obj.Normalize
Return Values
Returns the DAVector2 object.
TransformCreates a DAVector2 object that is the result of applying the given transformation to the original vector. The translation elements of the transformation are ignored because translation does not apply to vectors.
vector2Obj.Transform(
xf
)Parameters
- xf
- A DATransform2 object.
Return Values
Returns the DAVector2 object.
Remarks
This function composes values. The resulting transformation is the new value applied to the old value.
DAVector2 Properties
LengthA read-only property with a DANumber value that represents the length of a DAVector2 object.
vector2Obj.Length
See Also
LengthSquaredA read-only property with a DANumber value that represents the length of a DAVector2 object squared.
vector2Obj.LengthSquared
See Also
PolarCoordAngleA read-only property with a DANumber value that represents the counter-clockwise angular displacement, in radians, relative to the positive x-axis, of the DAVector2 object. The range is [-Pi, +Pi].
vector2Obj.PolarCoordAngle
PolarCoordLengthA read-only property with a DANumber value that represents the length (or magnitude) of the vector.
vector2Obj.PolarCoordLength
XA read-only property with a DANumber value that represents the X-coordinate of the DAVector2 object.
vector2Obj.X
See Also
YA read-only property with a DANumber value that represents the Y-coordinate of the DAVector2 object.
vector2Obj.Y
See Also
Relevant Functions from the DAStatics Class
The following functions are defined in the DAStatics class and are most relevant to objects of type DAVector2.
lib.Vector2BSpline(degree, knots, control_elements, weights, evaluation)
lib.Vector2PolarAnim(XYangle, length)
lib.Vector2Polar(XYangle, length)
lib.Vector2PolarDegrees(XYangle, length)
Relevant Properties from the DAStatics Class
The following properties are defined in the DAStatics class and are most relevant to objects of type DAVector2.
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.