File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 30
30
31
31
Reference : https://byjus.com/jee/simple-pendulum/
32
32
"""
33
-
33
+ from scipy . constants import g
34
34
35
35
def time_period_simple_pendulum (length : float ) -> float :
36
36
"""
37
37
>>> time_period_simple_pendulum(1.23)
38
- 2.2259685262423705
38
+ 2.2252136710666166
39
39
>>> time_period_simple_pendulum(2.37)
40
- 3.089873051721361
40
+ 3.088825235169592
41
41
>>> time_period_simple_pendulum(5.63)
42
- 4.762342885477521
42
+ 4.760727912429414
43
43
>>> time_period_simple_pendulum(-12)
44
44
Traceback (most recent call last):
45
45
...
@@ -49,7 +49,7 @@ def time_period_simple_pendulum(length: float) -> float:
49
49
"""
50
50
if length < 0 :
51
51
raise ValueError ("The length should be non-negative" )
52
- return (2 * 3.14159 ) * (length / 9.8 ) ** 0.5
52
+ return (2 * 3.14159 ) * (length / g ) ** 0.5
53
53
54
54
55
55
if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments