Vector3d
- class rhino3dm.Vector3d
- Vector3d(x, y, z)
Initializes a new instance of a vector, using its three components.
- Parameters:
x (float) – The X (first) component.
y (float) – The Y (second) component.
z (float) – The Z (third) component.
- X
float: Gets or sets the X (first) component of the vector.
- Y
float: Gets or sets the Y (second) component of the vector.
- Z
float: Gets or sets the Z (third) component of the vector.
- Encode()
[todo] add documentation
- __repr__()
[todo] add documentation
- IsParallelTo(other)
Determines whether this vector is parallel to another vector, within one degree (within Pi / 180).
- Parameters:
other (rhino3dm.Vector3d) – Vector to use for comparison.
- Returns:
Parallel indicator: +1 = both vectors are parallel 0 = vectors are not parallel, or at least one of the vectors is zero-1 = vectors are anti-parallel.
- Return type:
int
- IsParallelTo(other, angleTolerance)
Determines whether this vector is parallel to another vector, within one degree (within Pi / 180).
- Returns:
Parallel indicator: +1 = both vectors are parallel 0 = vectors are not parallel, or at least one of the vectors is zero-1 = vectors are anti-parallel.
- Return type:
int
- Unitize()
Unitizes the vector in place. A unit vector has length 1 unit. An invalid or zero length vector cannot be unitized.
- Returns:
True on success or False on failure.
- Return type:
bool
- Length()
[todo] add documentation
- static CrossProduct(a, b)
Computes the cross product (or vector product, or exterior product) of two vectors. This operation is not commutative.
- Parameters:
a (rhino3dm.Vector3d) – First vector.
b (rhino3dm.Vector3d) – Second vector.
- Returns:
A new vector that is perpendicular to both a and b, has Length == a.Length * b.Length * sin(theta) where theta is the angle between a and b.The resulting vector is oriented according to the right hand rule.
- Return type:
- static DotProduct(a, b)
[todo] add documentation
- static VectorAngle(a, b)
Compute the angle between two vectors. This operation is commutative.
- Parameters:
a (rhino3dm.Vector3d) – First vector for angle.
b (rhino3dm.Vector3d) – Second vector for angle.
- Returns:
If the input is valid, the angle (in radians) between a and b; RhinoMath.UnsetValue otherwise.
- Return type:
float
- static VectorAngle(a, b, plane)
Compute the angle between two vectors. This operation is commutative.
- Returns:
If the input is valid, the angle (in radians) between a and b; RhinoMath.UnsetValue otherwise.
- Return type:
float
- static VectorAngle(v1, v2, vNormal)
Compute the angle between two vectors. This operation is commutative.
- Returns:
If the input is valid, the angle (in radians) between a and b; RhinoMath.UnsetValue otherwise.
- Return type:
float