DAVector2 Class

Creates a DAVector2 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 DAVector2 object can change over time as the values of the animated numbers change.

This class inherits from the DABehavior class.

For relevant functions and properties from the DAStatics class, see the following topics.

DAVector2 Functions

Div 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. Same as DivAnim except that scalar is a nonanimated number (a double).
DivAnim 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.
Mul Creates a DAVector2 object that points in the same direction as the original vector but has a length that has been multiplied by scalar. Same as MulAnim except that scalar is a nonanimated number (a double).
MulAnim Creates a DAVector2 object that points in the same direction as the original vector but has a length that has been multiplied by scalar.
NormalizeCreates a normalized, two-dimensional DAVector2 object.
TransformCreates a DAVector2 object that is the result of applying the given transformation to the original vector.

DAVector2 Properties

LengthA read-only property with a DANumber value that represents the length of a DAVector2 object.
LengthSquaredA read-only property with a DANumber value that represents the length of a DAVector2 object squared.
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.
PolarCoordLengthA read-only property with a DANumber value that represents the length (or magnitude) of the vector.
XA read-only property with a DANumber value that represents the x-coordinate of the DAVector2 object.
YA read-only property with a DANumber value that represents the y-coordinate of the DAVector2 object.

DAVector2 Functions

This section contains reference material for the DAVector2 functions.

Div

DAVector2 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. Same as DivAnim except that scalar is a nonanimated number (a double).

Syntax

vector2Obj.Div( scalar )

Parameters

scalar
A double value used as the divider. This is a nonanimated number.

Return Value

Returns the DAVector2 object.

DivAnim

DAVector2 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.

Syntax

vector2Obj.DivAnim( scalar )

Parameters

scalar
DANumber object used as the divider. This must be an animated number.

Return Value

Returns the DAVector2 object.

See Also

MulAnim

Mul

DAVector2 Class

Creates a DAVector2 object that points in the same direction as the original vector but has a length that has been multiplied by scalar. Same as MulAnim except that scalar is a nonanimated number (a double).

Syntax

vector2Obj.Mul( scalar )

Parameters

scalar
A double value used as the multiplier. This is a nonanimated number.

Return Value

Returns the DAVector2 object.

MulAnim

DAVector2 Class

Creates a DAVector2 object that points in the same direction as the original vector but has a length that has been multiplied by scalar.

Syntax

vector2Obj.MulAnim( scalar )

Parameters

scalar
DANumber object used as the multiplier. This must be an animated number.

Return Value

Returns the DAVector2 object.

See Also

DivAnim

Normalize

DAVector2 Class

Creates a normalized, two-dimensional DAVector2 object. The normalized vector has the same direction as the original vector, but the length is 1.

Syntax

vector2Obj.Normalize( )

Return Value

Returns the DAVector2 object.

Transform

DAVector2 Class

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.

Syntax

vector2Obj.Transform( xf )

Parameters

xf
DATransform2 object.

Return Value

Returns the DAVector2 object.

Remarks

This function composes values. The resulting transformation is the new value applied to the old value.

DAVector2 Properties

This section contains reference material for the DAVector2 properties.

Length

DAVector2 Class

A read-only property with a DANumber value that represents the length of a DAVector2 object.

Syntax

vector2Obj.Length

See Also

LengthSquared

LengthSquared

DAVector2 Class

A read-only property with a DANumber value that represents the length of a DAVector2 object squared.

Syntax

vector2Obj.LengthSquared

See Also

Length

PolarCoordAngle

DAVector2 Class

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].

Syntax

vector2Obj.PolarCoordAngle

PolarCoordLength

DAVector2 Class

A read-only property with a DANumber value that represents the length (or magnitude) of the vector.

Syntax

vector2Obj.PolarCoordLength

X

DAVector2 Class

A read-only property with a DANumber value that represents the x-coordinate of the DAVector2 object.

Syntax

vector2Obj.X

See Also

Y, Vector2Anim

Y

DAVector2 Class

A read-only property with a DANumber value that represents the y-coordinate of the DAVector2 object.

Syntax

vector2Obj.Y

See Also

X, Vector2Anim


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