public class Circles
extends java.lang.Object
Circle
objects.Modifier and Type | Method and Description |
---|---|
static java.awt.geom.Rectangle2D.Double |
boundingBox(java.util.ArrayList<Circle> circles)
Calculate the bounding box of all circles.
|
static Circle |
boundingCircle(java.util.ArrayList<Circle> circles)
Calculate the bounding circle of all circles.
|
static double |
circumradius(double ra,
double rb,
double rc)
Computes the circumradius of the reference triangle for three tightly packed
circles.
|
static double |
innerSoddyRadius(double ra,
double rb,
double rc)
Computes the radius of the inner soddy circle for three tightly packed
circles.
|
static void |
main(java.lang.String[] arg) |
static Circle |
outerSoddyCircle(Circle circleA,
Circle circleB,
Circle circleC)
Computes the outer soddy circle for three tightly packed
circles.
|
static double |
outerSoddyRadius(double ra,
double rb,
double rc)
Computes the radius of the outer soddy circle for three tightly packed
circles.
|
static void |
pairPack(java.util.ArrayList<Circle> circles)
Packs circles closely together into a circle around the center of
the coordinate system by creating a list of already packed pairs of
circles.
|
static void |
phyllotacticPack(java.util.ArrayList<Circle> circles)
Packs circles closely together into a circle around the center of
the coordinate system using a phyllotactic pattern.
|
public static java.awt.geom.Rectangle2D.Double boundingBox(java.util.ArrayList<Circle> circles)
circles
- public static Circle boundingCircle(java.util.ArrayList<Circle> circles)
circles
- public static void phyllotacticPack(java.util.ArrayList<Circle> circles)
Phyllotactic patterns occur in nature, for example in the seeds of a sunflower.
In a phyllotactic pattern, the polar coordinates for the n
th object
are:
radius = rc * Math.sqrt(i+1), ra = (i+1) * 137.5°Where
rc
is the spacing constant, and 137.5° is the angular constant.
The current implementation yields only good results, if all circles are of the same size.
circles
- public static void pairPack(java.util.ArrayList<Circle> circles)
The following algorithm is used:
circles
- public static double innerSoddyRadius(double ra, double rb, double rc)
ra
- Radius of circle Arb
- Radius of circle Brc
- Radius of circle Cpublic static double outerSoddyRadius(double ra, double rb, double rc)
ra
- Radius of circle Arb
- Radius of circle Brc
- Radius of circle Cpublic static double circumradius(double ra, double rb, double rc)
ra
- Radius of circle Arb
- Radius of circle Brc
- Radius of circle Cpublic static Circle outerSoddyCircle(Circle circleA, Circle circleB, Circle circleC)
circleA
- Circle racircleB
- Circle rbcircleC
- Circle rcpublic static void main(java.lang.String[] arg)