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.
Creates 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
)
Returns the DAVector2 object.
Same as DivAnim except that scalar is a non-animated number (a double).
vector2Obj.Div(
scalar
)
Creates 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
)
Returns the DAVector2 object.
Same as MulAnim except that scalar is a non-animated number (a double).
vector2Obj.Mul(
scalar
)
Creates a normalized, two-dimensional DAVector2 object. The normalized vector has the same direction as the original vector, but the length is 1.
vector2Obj.Normalize
Returns the DAVector2 object.
Creates 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
)
Returns the DAVector2 object.
This function composes values. The resulting transformation is the new value applied to the old value.
A read-only property with a DANumber value that represents the length of a DAVector2 object.
vector2Obj.Length
A read-only property with a DANumber value that represents the length of a DAVector2 object squared.
vector2Obj.LengthSquared
A 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
A read-only property with a DANumber value that represents the length (or magnitude) of the vector.
vector2Obj.PolarCoordLength
A read-only property with a DANumber value that represents the X-coordinate of the DAVector2 object.
vector2Obj.X
A read-only property with a DANumber value that represents the Y-coordinate of the DAVector2 object.
vector2Obj.Y
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)
The following properties are defined in the DAStatics class and are most relevant to objects of type DAVector2.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.