Skip to content

Commit f01a7c1

Browse files
committed
Add truncated octahedron (python+C) model updated (rst issue and ruff)
1 parent 81c6d17 commit f01a7c1

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

sasmodels/models/octahedron_truncated.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,27 +151,26 @@
151151
name = "octahedron_truncated"
152152
title = "Truncated Octahedron."
153153
description = """
154+
AP = 6./(1.-3(1.-t)*(1.-t)*(1.-t))*(AA+BB+CC);
154155
155-
AP = 6./(1.-3(1.-t)*(1.-t)*(1.-t))*(AA+BB+CC);
156+
AA = 1./(2*(qy*qy-qz*qz)*(qy*qy-qx*qx))*((qy-qx)*sin(qy*(1.-t)-qx*t)+(qy+qx)*sin(qy*(1.-t)+qx*t))+
157+
1./(2*(qz*qz-qx*qx)*(qz*qz-qy*qy))*((qz-qx)*sin(qz*(1.-t)-qx*t)+(qz+qx)*sin(qz*(1.-t)+qx*t));
156158
157-
AA = 1./(2*(qy*qy-qz*qz)*(qy*qy-qx*qx))*((qy-qx)*sin(qy*(1.-t)-qx*t)+(qy+qx)*sin(qy*(1.-t)+qx*t))+
158-
1./(2*(qz*qz-qx*qx)*(qz*qz-qy*qy))*((qz-qx)*sin(qz*(1.-t)-qx*t)+(qz+qx)*sin(qz*(1.-t)+qx*t));
159+
BB = 1./(2*(qz*qz-qx*qx)*(qz*qz-qy*qy))*((qz-qy)*sin(qz*(1.-t)-qy*t)+(qz+qy)*sin(qz*(1.-t)+qy*t))+
160+
1./(2*(qx*qx-qy*qy)*(qx*qx-qz*qz))*((qx-qy)*sin(qx*(1.-t)-qy*t)+(qx+qy)*sin(qx*(1.-t)+qy*t));
159161
160-
BB = 1./(2*(qz*qz-qx*qx)*(qz*qz-qy*qy))*((qz-qy)*sin(qz*(1.-t)-qy*t)+(qz+qy)*sin(qz*(1.-t)+qy*t))+
161-
1./(2*(qx*qx-qy*qy)*(qx*qx-qz*qz))*((qx-qy)*sin(qx*(1.-t)-qy*t)+(qx+qy)*sin(qx*(1.-t)+qy*t));
162+
CC = 1./(2*(qx*qx-qy*qy)*(qx*qx-qz*qz))*((qx-qz)*sin(qx*(1.-t)-qz*t)+(qx+qz)*sin(qx*(1.-t)+qz*t))+
163+
1./(2*(qy*qy-qz*qz)*(qy*qy-qx*qx))*((qy-qz)*sin(qy*(1.-t)-qz*t)+(qy+qz)*sin(qy*(1.-t)+qz*t));
162164
163-
CC = 1./(2*(qx*qx-qy*qy)*(qx*qx-qz*qz))*((qx-qz)*sin(qx*(1.-t)-qz*t)+(qx+qz)*sin(qx*(1.-t)+qz*t))+
164-
1./(2*(qy*qy-qz*qz)*(qy*qy-qx*qx))*((qy-qz)*sin(qy*(1.-t)-qz*t)+(qy+qz)*sin(qy*(1.-t)+qz*t));
165+
Normalisation to 1. of AP at q = 0. Division by a Factor 4/3.
165166
166-
normalisation to 1. of AP at q = 0. Division by a Factor 4/3.
167167
Qx = q * sin_theta * cos_phi;
168168
Qy = q * sin_theta * sin_phi;
169169
Qz = q * cos_theta;
170170
qx = Qx * length_a;
171171
qy = Qy * length_b;
172172
qz = Qz * length_c;
173173
0 < t < 1
174-
175174
"""
176175
category = "shape:parallelepiped"
177176

0 commit comments

Comments
 (0)