toxi.geom
Class Circle

java.lang.Object
  extended by toxi.geom.Vec2D
      extended by toxi.geom.Ellipse
          extended by toxi.geom.Circle
All Implemented Interfaces:
java.lang.Comparable<Vec2D>

public class Circle
extends Ellipse

This class overrides Ellipse to define a 2D circle and provides several utility methods for it.


Nested Class Summary
 
Nested classes/interfaces inherited from class toxi.geom.Vec2D
Vec2D.Axis
 
Field Summary
 
Fields inherited from class toxi.geom.Vec2D
MAX_VALUE, MIN_VALUE, x, X_AXIS, y, Y_AXIS, ZERO
 
Constructor Summary
Circle()
           
Circle(Circle c)
           
Circle(float radius)
           
Circle(float x, float y, float radius)
           
Circle(Vec2D origin, float radius)
           
 
Method Summary
 boolean containsPoint(Vec2D p)
           
 float getCircumference()
          Computes the approximate circumference of the ellipse, using this equation: 2 * PI * sqrt(1/2 * (rx*rx+ry*ry)).
 float getRadius()
           
 Vec2D[] getTangentPoints(Vec2D p)
           
 Vec2D[] intersectsCircle(Circle c)
           
 Circle setRadius(float r)
           
 
Methods inherited from class toxi.geom.Ellipse
getArea, getFoci, getRadii, setRadii, setRadii
 
Methods inherited from class toxi.geom.Vec2D
abs, add, add, addSelf, addSelf, angleBetween, angleBetween, clear, closestPointOnLine, closestPointOnTriangle, compareTo, constrain, constrain, copy, cross, distanceTo, distanceToSquared, dot, equals, equalsWithTolerance, floor, frac, fromTheta, getAbs, getComponent, getConstrained, getFloored, getFrac, getInverted, getLimited, getNormalized, getNormalizedTo, getPerpendicular, getReciprocal, getRotated, getSignum, hashCode, heading, interpolateTo, interpolateTo, interpolateToSelf, interpolateToSelf, intersectRayCircle, invert, isInCircle, isInRectangle, isInTriangle, isZeroVector, jitter, jitter, jitter, limit, magnitude, magSquared, max, max, maxSelf, min, min, minSelf, normalize, normalizeTo, perpendicular, pointInPolygon, randomVector, randomVector, reciprocal, rotate, scale, scale, scale, scaleSelf, scaleSelf, scaleSelf, set, set, setComponent, signum, sub, sub, subSelf, subSelf, tangentNormalOfEllipse, to3DXY, to3DXZ, to3DYZ, toArray, toCartesian, toPolar, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Circle

public Circle()

Circle

public Circle(Circle c)

Circle

public Circle(float radius)

Circle

public Circle(float x,
              float y,
              float radius)

Circle

public Circle(Vec2D origin,
              float radius)
Method Detail

containsPoint

public boolean containsPoint(Vec2D p)
Overrides:
containsPoint in class Ellipse

getCircumference

public float getCircumference()
Description copied from class: Ellipse
Computes the approximate circumference of the ellipse, using this equation: 2 * PI * sqrt(1/2 * (rx*rx+ry*ry)). The precise value is an infinite series elliptical integral, but the approximation comes sufficiently close. See Wikipedia for more details: http://en.wikipedia.org/wiki/Ellipse

Overrides:
getCircumference in class Ellipse
Returns:
circumference

getRadius

public float getRadius()

getTangentPoints

public Vec2D[] getTangentPoints(Vec2D p)

intersectsCircle

public Vec2D[] intersectsCircle(Circle c)

setRadius

public Circle setRadius(float r)