Package com.titan.model
Class CelestialObject
java.lang.Object
com.titan.model.CelestialObject
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCelestialObject(String name, double m, Vector initialPos, Vector initialVel, double diameter, javafx.scene.paint.Color color, int radius) constructs a CelestialObjectCelestialObject(String name, double m, Vector initialPos, Vector initialVel, long diameter, javafx.scene.paint.Color color) -
Method Summary
Modifier and TypeMethodDescriptionjavafx.scene.paint.ColorgetColor()returns a color of a celestial objectdoublereturns the HashMap containing past positions of celestial objectsdoublegetM()returns the mass of a celestial objectgetName()returns the nameintreturns the radius of a celestial bodytoString()voidupdatePosition(Vector position) updates the current posistion of the celestial bodyvoidupdateVelocity(Vector velocity) updates the current velocity of a celestial body
-
Field Details
-
stepsUntilNextHistoricSave
public static int stepsUntilNextHistoricSave
-
-
Constructor Details
-
CelestialObject
-
CelestialObject
-
-
Method Details
-
getPosition
-
getVelocity
-
getDiameter
public double getDiameter()- Returns:
- returns the diameter of a celestial body
-
updatePosition
updates the current posistion of the celestial body- Parameters:
position-
-
updateVelocity
updates the current velocity of a celestial body- Parameters:
velocity-
-
getHistoricPositions
-
getM
public double getM()returns the mass of a celestial object- Returns:
-
getName
-
getColor
public javafx.scene.paint.Color getColor()returns a color of a celestial object- Returns:
-
toString
-
getRadius
public int getRadius()returns the radius of a celestial body- Returns:
-
toCSVString
-