IVector

class IVector

Bases: ImpactCOMWrapperBase

Description:

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.

Description:

Gets the angle of the vector.

Returns:

The value of Angle.

Return type:

angle (float)

property length

Gets Length.

Description:

Gets the length of the vector.

Returns:

The value of Length.

Return type:

length (float)

property x

Gets X.

Description:

Sets or gets the X coordinate of the vector.

Returns:

The value of X.

Return type:

x (float)

property y

Gets Y.

Description:

Sets or gets the Y coordinate of the vector.

Returns:

The value of Y.

Return type:

y (float)

add(vector)
Description:

Adds the values of another vector to a given vector.

Parameters:

vector (IVector) – The vector to add to this vector.

assign(source)
Description:

Assigns the properties of another IVector object to this object.

Parameters:

source (IVector) – Specifies the IVector object to assign properties from.

distance_to(other_vector)
Description:

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)
Description:

Divides a vector by a double value.

Parameters:

divisor (float) – Specifies the value to divide by.

equals(other_vector)
Description:

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.

multiply(multiplier)
Description:

Multiplies a vector by a given value.

Parameters:

multiplier (float) – Specifies the value to multiply by.

negate()
Description:

Negates the values in a vector

rotate(angle)
Description:

Rotates the vector.

Returns:

The new angle as a result of the rotation.

Parameters:

angle (float) – The angle to rotate the vector by.

subtract(vector)
Description:

Subtracts the value of another vector from a given vector.

Parameters:

vector (IVector) – Specifies the vector to subtract.

to_string()
Description:

Returns a string representation of the IVector.

transform(matrix)
Description:

Apply a transformation matrix to the entity.

Remarks:

Introduced in Impact 7.0.0.31.

Parameters:

matrix (IMatrix) – The matrix to be applied.