proteindf_bridge.position module

class proteindf_bridge.position.Position(*args, **kwds)[source]

Bases: object

>>> p = Position([5.0, 3.0, -1.2])
>>> p.x
5.0
>>> p.y
3.0
>>> p.z
-1.2
>>> p.x = 0.0
>>> p.y = 1.0
>>> p.z = 2.0
>>> p == Position([0, 1, 2])
True
>>> abs(abs(p) - 2.23606) < 1.0E-5
True
>>> _ = p.norm()
>>> p == Position([0, 1/math.sqrt(5), 2/math.sqrt(5)])
True
>>> p.move_to([3, 4, 5])
>>> p == Position([3.0, 4.0, 5.0])
True
>>> tmp = p * 2.0
>>> tmp == Position([6.0, 8.0, 10.0])
True
>>> tmp = (-1.0 * p)
>>> tmp == Position([-3.0, -4.0, -5.0])
True
>>> a = Position([1, 2, 3])
>>> b = Position([2, 3, 4])
>>> a * b
20.0
>>> p = a + b
>>> p == Position([3, 5, 7])
True
>>> a += b
>>> a == Position([3, 5, 7])
True
>>> p = a - b
>>> p == Position([1, 2, 3])
True
>>> a -= b
>>> a == Position([1, 2, 3])
True
>>> a.dot(b)
20.0
>>> n = a.cross(b)
>>> n == Position([-1, 2, -1])
True
cross(rhs)[source]

Compute the cross product.

distance_from(other=None)[source]
Return type:

float

dot(rhs)[source]

Compute the dot product.

get_raw_data()[source]
Return type:

List[float]

move_to(position)[source]
Return type:

None

norm()[source]
Return type:

Position

rotate(mat)[source]
Return type:

None

square_distance_from(other=None)[source]
Return type:

float

property x
property xyz
property y
property z