Resolves force along rectangular components. (force, angle) => (force_x, force_y) >>> import math >>> force = polar_force(10, 45) >>> math.isclose(force[0], 7.071067811865477) True >>> math.isclose(force[1], 7.0710678118654755) True >>> force = polar_force(10, 3.
(
magnitude: float, angle: float, radian_mode: bool = False
)
| 9 | |
| 10 | |
| 11 | def polar_force( |
| 12 | magnitude: float, angle: float, radian_mode: bool = False |
| 13 | ) -> list[float]: |
| 14 | """ |
| 15 | Resolves force along rectangular components. |
| 16 | (force, angle) => (force_x, force_y) |
| 17 | >>> import math |
| 18 | >>> force = polar_force(10, 45) |
| 19 | >>> math.isclose(force[0], 7.071067811865477) |
| 20 | True |
| 21 | >>> math.isclose(force[1], 7.0710678118654755) |
| 22 | True |
| 23 | >>> force = polar_force(10, 3.14, radian_mode=True) |
| 24 | >>> math.isclose(force[0], -9.999987317275396) |
| 25 | True |
| 26 | >>> math.isclose(force[1], 0.01592652916486828) |
| 27 | True |
| 28 | """ |
| 29 | if radian_mode: |
| 30 | return [magnitude * cos(angle), magnitude * sin(angle)] |
| 31 | return [magnitude * cos(radians(angle)), magnitude * sin(radians(angle))] |
| 32 | |
| 33 | |
| 34 | def in_static_equilibrium( |
no test coverage detected