|
1 | 1 | """ |
2 | | -Finding collision types and final velocities is key in physics. |
| 2 | +Collision types and final velocities are central to physics. |
3 | 3 | This module computes final velocities for inelastic and elastic collisions. |
4 | | -It also identifies the collision type from initial and final velocities. |
| 4 | +It also classifies the collision type from initial and final velocities. |
5 | 5 |
|
6 | 6 | Description: Collisions happen when two masses interact head-on. |
7 | 7 | There are two types: inelastic and elastic. In inelastic collisions, the |
8 | 8 | masses stick together and share one final velocity. In elastic collisions, |
9 | | -momentum and kinetic energy stay conserved, and the masses rebound. |
10 | | -Momentum is mass times velocity, and kinetic energy is 1/2 mv^2. |
11 | | -The type of collision can be found by comparing the system's initial and |
12 | | -final momentum and kinetic energy. |
| 9 | +momentum and kinetic energy are conserved, and masses rebound. |
| 10 | +Momentum is mass times velocity; kinetic energy is 1/2 mv^2. |
| 11 | +The collision type comes from comparing initial and final momentum and |
| 12 | +kinetic energy of the system. |
13 | 13 |
|
14 | 14 | Reference: https://en.wikipedia.org/wiki/Collision |
15 | 15 | """ |
@@ -118,7 +118,7 @@ def type_collision( |
118 | 118 |
|
119 | 119 | if kinetic_final == kinetic_initial and momentum_initial == momentum_final: |
120 | 120 | return 'Perfectly Elastic Collision' |
121 | | - elif not(kinetic_final == kinetic_initial) and momentum_initial == momentum_final: |
| 121 | + elif kinetic_final != kinetic_initial and momentum_initial == momentum_final: |
122 | 122 | return 'Perfectly Inelastic Collision' |
123 | 123 | else: |
124 | 124 | return "Inelastic Collision" |
|
0 commit comments