The parameters "size" & "color" are not relevant for the simulation itself, they are only used for plotting.
(
self,
position_x: float,
position_y: float,
velocity_x: float,
velocity_y: float,
mass: float = 1.0,
size: float = 1.0,
color: str = "blue",
)
| 27 | |
| 28 | class Body: |
| 29 | def __init__( |
| 30 | self, |
| 31 | position_x: float, |
| 32 | position_y: float, |
| 33 | velocity_x: float, |
| 34 | velocity_y: float, |
| 35 | mass: float = 1.0, |
| 36 | size: float = 1.0, |
| 37 | color: str = "blue", |
| 38 | ) -> None: |
| 39 | """ |
| 40 | The parameters "size" & "color" are not relevant for the simulation itself, |
| 41 | they are only used for plotting. |
| 42 | """ |
| 43 | self.position_x = position_x |
| 44 | self.position_y = position_y |
| 45 | self.velocity_x = velocity_x |
| 46 | self.velocity_y = velocity_y |
| 47 | self.mass = mass |
| 48 | self.size = size |
| 49 | self.color = color |
| 50 | |
| 51 | @property |
| 52 | def position(self) -> tuple[float, float]: |
nothing calls this directly
no outgoing calls
no test coverage detected