2.1.2.7. Vector

class Valentina.Geometry.Vector.HomogeneousVector2D(vector)[source]

Bases: Valentina.Geometry.Vector.Vector2D

2D Homogeneous Coordinate Vector

to_vector()[source]
v
w
class Valentina.Geometry.Vector.NormalisedVector2D(*args)[source]

Bases: Valentina.Geometry.Vector.Vector2DFloatBase

2D Normalised Vector

class Valentina.Geometry.Vector.Vector2D(*args)[source]

Bases: Valentina.Geometry.Vector.Vector2DFloatBase

2D Vector

Example of usage:

Vector(1, 3)
Vector((1, 3))
Vector([1, 3])
Vector(iterable)
Vector(vector)
static from_angle(angle)[source]

Create the unitary vector (cos(angle), sin(angle)). The angle is in degree.

static middle(p0, p1)[source]

Return the middle point.

normalise()[source]

Normalise the vector

rint()[source]
to_normalised()[source]

Return a normalised vector

class Valentina.Geometry.Vector.Vector2DBase(*args)[source]

Bases: Valentina.Geometry.Primitive.Primitive2D

Example of usage:

Vector(1, 3)
Vector((1, 3))
Vector([1, 3])
Vector(iterable)
Vector(vector)
clone()[source]
copy()[source]

Return a copy of self

to_int_list()[source]
v
x
y
class Valentina.Geometry.Vector.Vector2DFloatBase(*args)[source]

Bases: Valentina.Geometry.Vector.Vector2DBase

Example of usage:

Vector(1, 3)
Vector((1, 3))
Vector([1, 3])
Vector(iterable)
Vector(vector)
almost_equal(v1, v2, rtol=1e-05, atol=1e-08, equal_nan=False)[source]

self ~= other

anti_normal()[source]

Return a new vector equal to self rotated of 90 degree in the clockwise direction

bounding_box()[source]
cos_with(direction)[source]

Return the cosinus of self with direction

cross(other)[source]

Return the cross product of self with other

deviation_with(direction)[source]

Return the deviation of self with other

dot(other)[source]

Return the dot product of self with other

inverse_tan()[source]

Return the inverse tangent

is_orthogonal(other)[source]

Self is orthogonal with other

is_parallel(other)[source]

Self is parallel with other

magnitude()[source]

Return the magnitude of the vector

magnitude_square()[source]

Return the square of the magnitude of the vector

normal()[source]

Return a new vector equal to self rotated of 90 degree in the counter clockwise direction

orientation()[source]

Return the orientation in degree

orientation_with(direction)[source]

Return the angle of self on direction

parity()[source]

Return a new vector equal to self rotated of 180 degree

projection_on(direction)[source]

Return the projection of self on direction

rotate(angle, counter_clockwise=True)[source]

Return a new vector equal to self rotated of angle degree in the counter clockwise direction

sin_with(direction)[source]

Return the sinus of self with other

tan()[source]

Return the tangent

class Valentina.Geometry.Vector.Vector2DInt(*args)[source]

Bases: Valentina.Geometry.Vector.Vector2DBase

Example of usage:

Vector(1, 3)
Vector((1, 3))
Vector([1, 3])
Vector(iterable)
Vector(vector)
bounding_box()[source]