class Vector3D

class NemAll_Python_Geometry.Vector3D

Representation class for 3D Vector.

CrossProduct(vec: Vector3D) None

Cross(vector) product operator.

Formula: Va = Va x Vb Va is this Vector

Args:

vec:  Vector(Vb).

DotProduct(vec: Vector3D) float

Dot(sxcalar) product.

Formula: S = Va . Vb = Va1 * Va2 + Vb1 * Vb2 Va is this Vector

Args:

vec:  Vector(Vb).

Returns:

double.

GetCoords() Tuple[float, float, float]

Get copy of X,Y,Z coordinates

Returns:

tuple(X coordinate of vector,
      Y coordinate of vector,
     Z coordinate of vector)

GetLength() float

Get vector length.

Formula: Result(double) = ||Va|| Va is this vector

Returns:

double.

GetLengthSquare() float

Get vector length without square-root in calculation.

Returns:

double.

IsZero() bool

Check the coords [0.0, 0.0, 0.0]

If the coords are zero, the return value is true. If the coords aren’t zero, the return value is false.

Returns:

Is zero? true/false

Normal(vec: Vector3D) Vector3D

Does the same as Cross(vector) product but does not change the operands.

Formula: Vc = Va x Vb Va is this Vector

Args:

vec:  Vector(Vb).

Normalize(...)
Normalize() object

Normalize vector.

Formula: Vn(a1/||Va||, a2/||Va||) Va is this vector This method is checked and throwing a geometry exception when vector is zero.

Returns:

Geometry error code

Normalize(length: float) object

Normalize vector to new length.

Formula: Vn(a1 * length / ||Va||, a2 * length / ||Va||) Va is this vector This method is checked and throwing a geometry exception when vector is zero.

Args:

length:  new length of vector.

Returns:

Geometry error code

Project(vec: Vector3D) Vector3D

Projection operator.

Formula: Vc = <Vb,Va>/<Va,Va> . Va Va is this Vector

Args:

vec:  Vector(Vb).

Returns:

new Vector(Vc).

Reverse() Vector3D

Compute reversed vector

Method calculate vector with reversed orientation.

Returns:

Reversed vector

Set(...)
Set(vec: Vector3D) None

Initialize from vector 3D.

Args:

vec:  Vector.

Set(x: float, y: float, z: float) None

Initialize from x,y,z coordinates.

Args:

x:  coordinate.
y:  coordinate.
z:  coordinate.

Set(startPoint: Point3D, endPoint: Point3D) None

Initialize vector from two points.

Args:

startPoint:  start point of vector.
endPoint:    end point of vector.

Values() list(double]

Get copy of X,Y,Z coordinates as python list

Returns:

X coordinate of vector.,
Y coordinate of vector.,
Z coordinate of vector.

__add__(vec: Vector3D) Vector3D

Addition operator.

Formula: Vc = Va + Vb Va is this Vector.

Args:

vec:  Vector(Vb).

Returns:

new Vector(Vc).

__eq__(vec: Vector3D) bool

Comparison of vectors without tolerance.

Be careful, this method work without tolerance!

Args:

vec:  Compared vector.

Returns:

True when points are equal, otherwise false.

__iadd__(vec: Vector3D) Vector3D

Addition assignment operator.

Formula: Va = Va + Vb Va is this Vector.

Args:

vec:  Vb Vector.

Returns:

Reference to vector.

__idiv__(divider: float) Vector3D

Multiply the vector by a factor (scalar multiplication)

Args:

divider:  scaling divider

Returns:

New vector

__imul__(...)
__imul__(vec: Vector3D) Vector3D

Cross(vector) product operator.

Formula: Va = Va x Vb Va is this Vector

Args:

vec:  Vector(Vb).

Returns:

Reference to the cross(vector) product of vectors.

__imul__(factor: float) Vector3D

Multiply the vector by a factor (scalar multiplication)

Args:

factor:  Scale factor

Returns:

New vector

__imul__(matrix: Matrix2D) Vector3D

2D matrix transformation.

Formula: Vector(this) = Vector(this) * matrix

Args:

matrix:  2D transformation matrix.

Returns:

Point.

__imul__(matrix: Matrix3D) Vector3D

3D matrix transformation.

Formula: Vector(this) = Vector(this) * matrix

Args:

matrix:  3D transformation matrix.

Returns:

Point.

__init__(...)
__init__() None
__init__(vec: Vector2D) None

Copy constructor.

Copy only X_COORD and Y_COORD from vector, Z_COORD is set to zero.

Args:

vec:  2D vector which will be copied to the 3D vector.

__init__(vec: Vector3D) None

Copy constructor.

Args:

vec:  vector which will be copied.

__init__(x: float, y: float, z: float) None

Constructor.

Initialize vector from single coordinates.

Args:

x:  X coordinate of vector.
y:  Y coordinate of vector.
z:  Z coordinate of vector.

__init__(startPoint: Point3D, endPoint: Point3D) None

Constructor.

Initialize vector from two points.

Args:

startPoint:  start point of vector.
endPoint:    end point of vector.

__init__(endPoint: Point3D) None

Create a vector from a 3D point

Args:

endPoint:  End point of the vector (startpoint is 0./0./0.)

__isub__(vec: Vector3D) Vector3D

Subtraction assignment operator.

Formula: Va = Va - Vb Va is this Vector.

Args:

vec:  Vb Vector.

Returns:

Reference to vector.

__mul__(...)
__mul__(vec: Vector3D) Vector3D

Cross(vector) product operator.

Formula: Vc = Va x Vb Va is this Vector

Args:

vec:  Vector(Vb).

Returns:

new Vector(Vc).

__mul__(factor: float) Vector3D

Multiply the vector by a factor (scalar multiplication)

Args:

factor:  Scale factor

Returns:

New vector

__mul__(matrix: Matrix2D) Vector3D

2D matrix transformation.

Formula: Result = Vector(this) * matrix

Args:

matrix:  2D transformation matrix.

Returns:

Point.

__mul__(matrix: Matrix3D) Vector3D

3D matrix transformation.

Formula: Result = Vector(this) * matrix

Args:

matrix:  3D transformation matrix.

Returns:

Point.

__ne__(vec: Vector3D) bool

Comparison of vectors without tolerance.

Be careful, this method work without tolerance!

Args:

vec:  Compared vector.

Returns:

True when points are not equal, otherwise false.

__repr__() str

Convert to string

__sub__(vec: Vector3D) Vector3D

Subtraction operator.

Formula: Vc = Va - Vb Va is this Vector

Args:

vec:  Vector(Vb).

Returns:

new Vector(Vc).

__truediv__(divider: float) Vector3D

Multiply the vector by a factor (scalar multiplication)

Args:

divider:  scaling divider

Returns:

New vector

property X: float

Get the X coordinate reference.

Set the X coordinate reference.

property Y: float

Get the Y coordinate reference.

Set the Y coordinate reference.

property Z: float

Get the Z coordinate reference.

Set the Z coordinate reference.

__module__ = 'NemAll_Python_Geometry'