sim.physics2D.shape
Class Circle
java.lang.Object
sim.physics2D.shape.Shape
sim.physics2D.shape.Circle
public class Circle
- extends Shape
The Circle class is used by a circular physical object to store the attributes
of its appearance and size
Constructor Summary |
Circle(double radius,
java.awt.Paint paint)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Circle
public Circle(double radius,
java.awt.Paint paint)
getRadius
public double getRadius()
getMassMomentOfInertia
public double getMassMomentOfInertia(double mass)
- Calculates the mass moment of inertia for a circle based on its mass
- Specified by:
getMassMomentOfInertia
in class Shape
draw
public void draw(java.lang.Object object,
java.awt.Graphics2D graphics,
DrawInfo2D info)
- Display the circle
- Specified by:
draw
in class Shape
calcMaxDistances
public void calcMaxDistances(boolean mobile)
- Calculate the max distance a point can be from the center of the object.
For polygons, this can be different if the object is moving (rotating).
For circles, this is alway the same.
- Specified by:
calcMaxDistances
in class Shape
getMaxXDistanceFromCenter
public double getMaxXDistanceFromCenter()
- Specified by:
getMaxXDistanceFromCenter
in class Shape
getMaxYDistanceFromCenter
public double getMaxYDistanceFromCenter()
- Specified by:
getMaxYDistanceFromCenter
in class Shape