BioSimSpace.Types.Vector

class BioSimSpace.Types.Vector(x, y, z)[source]

A three-vector.

__init__(x, y, z)[source]

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)[source]

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)[source]

Return the cross product with the other vector.

Parameters:

other – Another vector.

Returns:

result – The cross product.

Return type:

class:

Vector

dot(other)[source]

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

Parameters:

other – Another vector.

Returns:

result – The scalar product.

Return type:

float

magnitude()[source]

Return the magnitude of the vector.

Returns:

length – The magnitude of the vector.

Return type:

float

normalise()[source]

Normalise the vector.

Returns:

vector – The normalised vector.

Return type:

class:

Vector

x()[source]

Return the x component of the vector.

Returns:

x – The x component of the vector.

Return type:

float

y()[source]

Return the y component of the vector.

Returns:

y – The y component of the vector.

Return type:

float

z()[source]

Return the z component of the vector.

Returns:

z – The z component of the vector.

Return type:

float