Skip to content

Commit 777ba32

Browse files
Reorder calculations
1 parent d208a5d commit 777ba32

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sectionproperties/tests/test_stress.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ def test_rotated_rectangle():
6767
b = 50
6868
d = 100
6969
angle = math.atan(100 / 50)
70+
cx = b / 2 * math.cos(angle) - d / 2 * math.sin(angle)
71+
cy = b / 2 * math.sin(angle) + d / 2 * math.cos(angle)
72+
Sy = b * d / 6.0 * cy
73+
Mxx = 7
74+
sig_max = Mxx / Sy
7075
rot_rect = (
7176
primitive_sections.rectangular_section(b=b, d=d)
7277
.shift_section(-b / 2, -d / 2)
@@ -76,10 +81,5 @@ def test_rotated_rectangle():
7681
rot_sec = Section(rot_rect)
7782
rot_sec.calculate_geometric_properties()
7883
rot_sec.calculate_warping_properties()
79-
Mxx = 7
80-
cx = b / 2 * math.cos(angle) - d / 2 * math.sin(angle)
81-
cy = b / 2 * math.sin(angle) + d / 2 * math.cos(angle)
82-
Sy = b * d / 6.0 * cy
83-
sig_max = Mxx / Sy
8484
(sig_0, sig_1) = rot_sec.get_stress_at_points(pts=[[cx, 0], [cx, cy]], Mxx=Mxx)
8585
assert sig_1 == pytest.approx((sig_max, 0, 0))

0 commit comments

Comments
 (0)