Planet Objects

Objects that store the parameters associated with a planet.

class planet.Planet(a, p, r, e, w, color, planet_r_scale=25)

A class that stores the information for a planet.

This class keeps track of the orbital distances, relative radii, and the color of each planet that should be plotted in a given system.

a

semi-major axis for planet in units of stellar radii

Type:

float

p

period for planet in any unit consistent with other planetary orbits

Type:

float

r

radius for planet in units of stellar radii

Type:

float

e

eccentricity for planet

Type:

float

w

argument of periastron for planet in units of radians

Type:

float

color

color which the planet itself (not the orbital circle) will be plotted with

Type:

str

x

x-coordinate defining position of planet along orbit

Type:

float

y

y-coordinate defining position of planet along orbit

Type:

float

solve_for_E(t)

Solve or the eccentric anomaly of the planet at a given time t.

Parameters:

t (float) – time at which to calculate the eccentric anomaly

update_pos(t)

Update the position of the planet along its orbit given a timestep.

Parameters:

t (float) – timestep defining how far to move planet along orbit