IVector¶
- class IVector¶
Bases:
ImpactCOMWrapperBase- Summary:
Represents a vector or coordinate.
Wraps a COM object or another wrapper instance. Accepts: - A valid impact_object - An existing impact_com_wrapper_base-derived instance
- property angle¶
Gets Angle.
- Summary:
Gets the angle of the vector.
- Returns:
The value of Angle.
- Return type:
angle (float)
- property length¶
Gets Length.
- Summary:
Gets the length of the vector.
- Returns:
The value of Length.
- Return type:
length (float)
- property x¶
Gets X.
- Summary:
Sets or gets the X coordinate of the vector.
- Returns:
The value of X.
- Return type:
x (float)
- property y¶
Gets Y.
- Summary:
Sets or gets the Y coordinate of the vector.
- Returns:
The value of Y.
- Return type:
y (float)
- add(vector)¶
- Summary:
Adds the values of another vector to a given vector.
- Parameters:
vector (IVector) – The vector to add to this vector.
Examples:
- assign(source)¶
- Summary:
Assigns the properties of another IVector object to this object.
- Parameters:
source (IVector) – Specifies the IVector object to assign properties from.
Examples:
- distance_to(other_vector)¶
- Summary:
Calculates the distance between this position vector and another.
- Remarks:
Introduced in Impact 8.0.0.36
- Returns:
The distance.
- Parameters:
other_vector (IVector) – The position from which to determine the distance.
Examples:
- divide(divisor)¶
- Summary:
Divides a vector by a double value.
- Parameters:
divisor (float) – Specifies the value to divide by.
Examples:
- equals(other_vector)¶
- Summary:
Determines if two vectors are equal.
- Remarks:
Introduced in Impact 8.0.0.39
- Returns:
True if the two points are coincident to within Impact’s built-in tolerance.
- Parameters:
other_vector (IVector) – The vector to be compared with this one.
Examples:
- isNone()¶
Checks if the COM object is None. This is useful for determining if the wrapper has been initialized with a valid COM object.
- multiply(multiplier)¶
- Summary:
Multiplies a vector by a given value.
- Parameters:
multiplier (float) – Specifies the value to multiply by.
Examples:
- negate()¶
- Summary:
Negates the values in a vector
Examples:
- rotate(angle)¶
- Summary:
Rotates the vector.
- Returns:
The new angle as a result of the rotation.
- Parameters:
angle (float) – The angle to rotate the vector by.
Examples:
- subtract(vector)¶
- Summary:
Subtracts the value of another vector from a given vector.
- Parameters:
vector (IVector) – Specifies the vector to subtract.
Examples:
- to_string()¶
- Summary:
Returns a string representation of the IVector.