sim.physics2D.shape
Class Circle

java.lang.Object
  extended by sim.physics2D.shape.Shape
      extended by 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


Field Summary
 
Fields inherited from class sim.physics2D.shape.Shape
index, paint, stationary
 
Constructor Summary
Circle(double radius, java.awt.Paint paint)
           
 
Method Summary
 void calcMaxDistances(boolean mobile)
          Calculate the max distance a point can be from the center of the object.
 void draw(java.lang.Object object, java.awt.Graphics2D graphics, DrawInfo2D info)
          Display the circle
 double getMassMomentOfInertia(double mass)
          Calculates the mass moment of inertia for a circle based on its mass
 double getMaxXDistanceFromCenter()
           
 double getMaxYDistanceFromCenter()
           
 double getRadius()
           
 
Methods inherited from class sim.physics2D.shape.Shape
getOrientation, getPaint, getPosition, setIndex, setPaint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Circle

public Circle(double radius,
              java.awt.Paint paint)
Method Detail

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