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. Normalize Creates a normalized, two-dimensional DAVector2 object. Transform Creates a DAVector2 object that is the result of applying the given transformation to the original vector.
DAVector2 Properties
Length A read-only property with a DANumber value that represents the length of a DAVector2 object. LengthSquared A read-only property with a DANumber value that represents the length of a DAVector2 object squared. PolarCoordAngle 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. PolarCoordLength A read-only property with a DANumber value that represents the length (or magnitude) of the vector. X A read-only property with a DANumber value that represents the x-coordinate of the DAVector2 object. Y A read-only property with a DANumber value that represents the y-coordinate of the DAVector2 object.
This section contains reference material for the DAVector2 functions.
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.
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
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.
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
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.
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.
This section contains reference material for the DAVector2 properties.
A read-only property with a DANumber value that represents the length of a DAVector2 object.
Syntax
vector2Obj.Length
See Also
A read-only property with a DANumber value that represents the length of a DAVector2 object squared.
Syntax
vector2Obj.LengthSquared
See Also
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
A read-only property with a DANumber value that represents the length (or magnitude) of the vector.
Syntax
vector2Obj.PolarCoordLength
A read-only property with a DANumber value that represents the x-coordinate of the DAVector2 object.
Syntax
vector2Obj.X
See Also
A read-only property with a DANumber value that represents the y-coordinate of the DAVector2 object.
Syntax
vector2Obj.Y
See Also
Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.