BioSimSpace.Types.Vector

class BioSimSpace.Types.Vector(x, y, z)

A three-vector.

__init__(x, y, z)

Constructor.

Parameters
  • x (float) – The x component of the vector.

  • y (float) – The y component of the vector.

  • z (float) – The z component of the vector.

Methods

__init__(x, y, z)

Constructor.

angle(other)

Return the angle between this and the other vector.

cross(other)

Return the cross product with the other vector.

dot(other)

Return the dot (scalar) product with the other vector.

magnitude()

Return the magnitude of the vector.

normalise()

Normalise the vector.

x()

Return the x component of the vector.

y()

Return the y component of the vector.

z()

Return the z component of the vector.

angle(other)

Return the angle between this and the other vector.

Parameters

other – Another vector.

Returns

angle – The angle between the two vectors.

Return type

class

Angle

cross(other)

Return the cross product with the other vector.

Parameters

other – Another vector.

Returns

result – The cross product.

Return type

class

Vector

dot(other)

Return the dot (scalar) product with the other vector.

Parameters

other – Another vector.

Returns

result – The scalar product.

Return type

float

magnitude()

Return the magnitude of the vector.

Returns

length – The magnitude of the vector.

Return type

float

normalise()

Normalise the vector.

Returns

vector – The normalised vector.

Return type

class

Vector

x()

Return the x component of the vector.

Returns

x – The x component of the vector.

Return type

float

y()

Return the y component of the vector.

Returns

y – The y component of the vector.

Return type

float

z()

Return the z component of the vector.

Returns

z – The z component of the vector.

Return type

float