molpy.op¶
rotate_by_quaternion ¶
rotate_by_quaternion(xyz, q)
Rotate coordinates using a quaternion.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xyz
|
ndarray
|
coordinates |
required |
q
|
ndarray
|
quaternion |
required |
Returns:
| Type | Description |
|---|---|
NDArray
|
np.ndarray: rotated coordinates |
Source code in src/molpy/op/geometry.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
rotate_by_rodrigues ¶
rotate_by_rodrigues(xyz, axis, theta)
Rotate coordinates around an axis by an angle theta. Using the Rodrigues' rotation formula.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xyz
|
ndarray
|
coordinates |
required |
axis
|
ndarray
|
rotation axis |
required |
theta
|
float
|
rotation angle |
required |
Returns:
| Type | Description |
|---|---|
NDArray
|
np.ndarray: rotated coordinates |
Source code in src/molpy/op/geometry.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | |
rotation_matrix_from_vectors ¶
rotation_matrix_from_vectors(vec1, vec2)
Find the rotation matrix that aligns vec1 to vec2 using the Rodrigues rotation formula.
Source code in src/molpy/op/geometry.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | |
translate ¶
translate(xyz, vector)
Translate coordinates by a vector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xyz
|
ndarray
|
coordinates |
required |
vector
|
ndarray
|
translation vector |
required |
Returns:
| Type | Description |
|---|---|
NDArray
|
np.ndarray: translated coordinates |
Source code in src/molpy/op/geometry.py
58 59 60 61 62 63 64 65 66 67 68 | |