Galaxy.h
Classes
- Galaxy -- Simple class to represent a Galaxy as a collection of Stars. (full description)
- Star -- Simple class which represents a star as a point mass. (full description)
Types
- POSITION
-
- VELOCITY
-
Interface
- Public Members
- Galaxy(Vector<Double>& position, Vector<Double>& velocity, Double mass, Double size, uInt numStars, uInt numRings, Double inclination, Double positionAngle, Int xSize, Int ySize)
- ~Galaxy()
- void computeStep(List<void *>& galaxyList, Double timeStep, Double dampingFactor = 1.0)
- void update()
- void applyForceToStars(List<void *>& galaxyList, Double timeStep, Double dampingFactor)
- void rotate(Matrix<Double>& rotMatrix)
- void draw(PixelCanvas *pixelCanvas)
- Double force(Double distance)
- Double getMass()
- Vector<Double>& getPosition()
- Vector<Double>& getVelocity()
- void setPlotMode(Galaxy::PLOT_MODE plotMode)
- void setScale(Int xSize, Int ySize)
Member Description
Galaxy(Vector<Double>& position, Vector<Double>& velocity, Double mass, Double size, uInt numStars, uInt numRings, Double inclination, Double positionAngle, Int xSize, Int ySize)
Constructor
Destructor
void computeStep(List<void *>& galaxyList, Double timeStep, Double dampingFactor = 1.0)
Compute a new position, applying the force of the Galaxies in the List
but do not update current position and velocity
update position and velocity to new value
void applyForceToStars(List<void *>& galaxyList, Double timeStep, Double dampingFactor)
Compute a new position for the Stars in this Galaxy
void rotate(Matrix<Double>& rotMatrix)
Rotate position and velocity
Draw the Galaxy on the PixelCanvas
Double force(Double distance)
magnitude of the force for this galaxy
Return the Mass of the Galaxy
Return the position of the Galaxy
Return the Velocity of the Galaxy
Set the plot mode
void setScale(Int xSize, Int ySize)
Interface
- Star(Vector<Double>& position, Vector<Double>& velocity, Int xSize, Int ySize)
- ~Star()
- void draw(PixelCanvas *pixelCanvas)
- void applyForce(List<void *>& galaxyList, Double timeStep, Double dampingFactor)
- void rotate(Matrix<Double>& rotMatrix)
- void setPlotMode(Galaxy::PLOT_MODE newPlotMode)
- void setScale(Int xSize, Int ySize)
Member Description
Star(Vector<Double>& position, Vector<Double>& velocity, Int xSize, Int ySize)
Constructor
Destructor
Draw the current position on the PixelCanvas
void applyForce(List<void *>& galaxyList, Double timeStep, Double dampingFactor)
Compute new position by applying the forces of the Galaxies in the List
void rotate(Matrix<Double>& rotMatrix)
Rotate position and velocity
Set the plot mode
void setScale(Int xSize, Int ySize)