- Timestamp:
- Oct 18, 2017 9:07:04 PM (7 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- aa6989b
- Parents:
- 3c24ccd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
explore/angles.py
r0d19f42 ref8e68c 114 114 vprint(var.reshape(n, 1), mat.reshape(n, 1), comment=comment, post=post) 115 115 116 # From wikipedia: 117 # https://en.wikipedia.org/wiki/Rotation_matrix#Basic_rotations 116 118 def Rx(a): 117 119 """Rotate y and z about x""" 118 return Matrix([[1, 0, 0], [0, cos(a), sin(a)], [0, -sin(a), cos(a)]]) 120 R = [[1, 0, 0], 121 [0, +cos(a), -sin(a)], 122 [0, +sin(a), +cos(a)]] 123 return Matrix(R) 119 124 120 125 def Ry(a): 121 126 """Rotate x and z about y""" 122 return Matrix([[cos(a), 0, sin(a)], [0, 1, 0], [-sin(a), 0, cos(a)]]) 127 R = [[+cos(a), 0, +sin(a)], 128 [0, 1, 0], 129 [-sin(a), 0, +cos(a)]] 130 return Matrix(R) 123 131 124 132 def Rz(a): 125 133 """Rotate x and y about z""" 126 return Matrix([[cos(a), sin(a), 0], [-sin(a), cos(a), 0], [0, 0, 1]]) 134 R = [[+cos(a), -sin(a), 0], 135 [+sin(a), +cos(a), 0], 136 [0, 0, 1]] 137 return Matrix(R) 127 138 128 139 … … 155 166 dq_xyz = Matrix([[dqx], [dqy], [dqz]]) 156 167 157 # By comparing the code we generate to sasmodel 4.x orientation code, we158 # are apparently using the opposite convention for phi than I expected.159 # Theta160 #theta = pi/2 - theta161 phi = -phi162 dphi = -dphi163 164 168 def print_steps(jitter, jitter_inv, view, view_inv, qc_only): 165 169 """
Note: See TracChangeset
for help on using the changeset viewer.