Module planet¶
-
class
pyspace.planet.
PlanetArray
¶ PlanetArray for storing planets
-
com
()¶ Return centre of mass of the system of planets
-
concatenate
()¶ Concatenates ‘other’ PlanetArray to self
-
dist
()¶ Distance between planet ‘i’ and planet ‘j’
Parameters:
- i, j: int
- Indices of planets whose distance is sought.
-
get_number_of_planets
()¶ Returns number of planets in the PlanetArray
Parameters:
None
Returns:
int: Number of planets in PlanetArray
-
kinetic_energy
()¶ Returns total kinetic energy of PlanetArray
-
kinetic_energy_planet
()¶ Returns kinetic energy of planet ‘j’
-
potential_energy
()¶ Returns total potential energy of PlanetArray
-
potential_energy_planet
()¶ Returns potential energy of planet ‘i’
Parameters:
- G: double
- Universal Gravitational constant
- i: int
- Index of the particle whose potential energy is sought
-
total_energy
()¶ Returns total energy of PlanetArray
-
total_energy_planet
()¶ Returns total energy of planet ‘i’
-