class Vector2D¶
- class NemAll_Python_Geometry.Vector2D¶
Representation class for 2D Vector.
- CrossProduct(vec: Vector2D) Vector3D ¶
Cross(vector) product operator.
Formula: Va = Va x Vb Va is this Vector
- Args:
vec:  Vector(Vb).
- Returns:
new Vector(Vc).
- DotProduct(vec: Vector2D) float ¶
Dot(sxcalar) product.
Formula: S = Va . Vb = Va1 * Va2 + Vb1 * Vb2 Va is this Vector
- Args:
vec:  Vector(Vb).
- Returns:
double.
- GetCoords() Tuple[double, double] ¶
Get copy of X,Y coordinates.
- Returns:
tuple(X coordinate of vector,
     Y coordinate of vector)
- GetLength() float ¶
Get vector length.
Formula: Result(double) = ||Va|| Va is this vector
- Returns:
double.
- IsZero() bool ¶
Check the coords [0.0, 0.0] (binary comparison)
- Returns:
Is zero? true/false
- Normalize(...)¶
- Normalize() None ¶
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.
- Normalize(length: float) None ¶
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.
- Orthogonal(counterClockwise: bool = True]) Vector2D ¶
Compute orthogonal vector
Method calculate orthogonal vector. Sample:
    vec = Vector2D(100., 0)
    vec.Orthogonal()
    # vec = (0., 100.);
- Args:
counterClockwise:  Orientation of orthogonal vector
- Returns:
Orthogonal vector
- Reverse() Vector2D ¶
Compute reversed vector
Method calculate vector with reversed orientation.
- Returns:
Reversed vector
- Set(...)¶
-
- Set(x: float, y: float) None ¶
Initialize from x,y coordinates.
- Args:
x:  coordinate.
y:  coordinate.
- Values() list(double] ¶
Get copy of X,Y coordinates as python list
- Returns:
X coordinate of vector.,
Y coordinate of vector.
- __add__(vec: Vector2D) Vector2D ¶
Addition operator.
Formula: Vc = Va + Vb Va is this Vector.
- Args:
vec:  Vector(Vb).
- Returns:
new Vector(Vc).
- __eq__(vec: Vector2D) 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: Vector2D) Vector2D ¶
Addition assignment operator.
Formula: Va = Va + Vb Va is this Vector.
- Args:
vec:  Vb Vector.
- Returns:
Reference to vector.
- __idiv__(divider: float) Vector2D ¶
Multiply the vector by a factor (scalar multiplication)
- Args:
divider:  scaling divider
- Returns:
New vector
- __imul__(...)¶
- __init__(...)¶
- __init__() None ¶
- __init__(angle: Angle, length: float) None ¶
Constructor.
Create vector from the angle and from the length. Formula: [X_COORD, Y_COORD] = [length*cos(angle), length*sin(angle)]
- Args:
angle:   base angle.
length:  length of vector (must be greater then zero).
- __init__(x: float, y: float) None ¶
Constructor.
Initialize vector from single coordinates.
- Args:
x:  X coordinate of vector.
y:  Y coordinate of vector.
- __init__(startPoint: Point2D, endPoint: Point2D) None ¶
Constructor.
Initialize vector from two points.
- Args:
startPoint:  start point of vector.
endPoint:    end point of vector.
- __isub__(vec: Vector2D) Vector2D ¶
Subtraction assignment operator.
Formula: Va = Va - Vb Va is this Vector.
- Args:
vec:  Vb Vector.
- Returns:
Reference to vector.
- __mul__(...)¶
- __mul__(vec: Vector2D) Vector3D ¶
Cross(vector) product operator.
Formula: Vc = Va x Vb Va is this Vector
- Args:
vec:  Vector(Vb).
- Returns:
new Vector(Vc).
- __ne__(vec: Vector2D) 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: Vector2D) Vector2D ¶
Subtraction operator.
Formula: Vc = Va - Vb Va is this Vector
- Args:
vec:  Vector(Vb).
- Returns:
new Vector(Vc).
- __truediv__(divider: float) Vector2D ¶
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.
- __module__ = 'NemAll_Python_Geometry'¶