public class Satellite extends Point
Constructor and Description |
---|
Satellite(double distance,
double angle,
double radius,
double speed,
java.lang.String name,
java.lang.String colour)
Constructor function.
|
Satellite(double distance,
double angle,
double radius,
double speed,
java.lang.String name,
java.lang.String colour,
Satellite primary)
Constructor method.
|
Modifier and Type | Method and Description |
---|---|
double |
getAngle()
Accessor function.
|
double |
getDistance()
Accessor function.
|
Satellite |
getPrimary()
Accessor function.
|
double |
getSpeed()
Accessor function.
|
void |
move()
Moves the body along its orbit according to its current speed.
|
void |
setSpeed(double speed)
Mutator function.
|
getColour, getDiameter, getFocus, getName, getRadius, setColour, setDiameter, setFocus, setName
public Satellite(double distance, double angle, double radius, double speed, java.lang.String name, java.lang.String colour, Satellite primary)
distance
- The distance of the body from its primary.radius
- The radius of the body (the table I used for values had
radii rather than diameters).angle
- The starting position of the body along its orbit.speed
- The speed of the body.name
- The name of the body.colour
- The colour of the body.primary
- The primary, or orbital target, of the satellite.public Satellite(double distance, double angle, double radius, double speed, java.lang.String name, java.lang.String colour)
distance
- The distance of the body from its primary.radius
- The radius of the body (the table I used for values had
radii rather than diameters).angle
- The starting position of the body along its orbit.speed
- The speed of the body.name
- The name of the body.colour
- The colour of the body.public void move()
public double getDistance()
public double getAngle()
public double getSpeed()
public Satellite getPrimary()
public void setSpeed(double speed)
speed
- Sets the speed of this body.