Static
buildBuild the n*n intersection matrix: contains the radical line at (i,j) if circle i and circle j do intersect; conatins null at (i,j) otherwise.
Note that this matrix is symmetrical: if circles (i,j) intersect with line (A,B), then also circles (j,i) intersect with line (B,A).
The returned two-dimensional matrix (array) has exactly as many entries as the passed circle array.
The circles to find intersections for.
A 2d-matrix containing the radical lines where circles intersect.
buildRadicalLineMatrix
CircleIntersections
Static
Private
findPrivate
Find the next adjacent circle interval for the given interval. starts the detection with any random section.
An array of all available interval sets/intervals.
randomUnusedInterval
CircleIntersections
Static
findFind all circles (indices) which are completely located inside another circle.
The returned array conatins the array indices.
The circles to find intersections for.
findInnerCircles
CircleIntersections
Static
findCalculate all outer circle intervals (sections that belong to the outermost line), dermined by the given circles and their radical lines.
The returned array contains IntervalSets - one for each circle - indicating the remaining circle sections.
findOuterCircleIntervals
CircleIntersections
Static
findCalculate the next connected partition from the given set of circles and outer path intervals. The function will pick a random unused circle interval and detect all adjacent intervals until a closed partition was found.
If an interval (circle section) was already visited will be stored in the usedIntervalSetRecords
matrix (thus
is must be large enough to map all sections).
The returned array contains IndexPairs (i,j) - one for each circle i - indicating the used circle section j.
The circles to find intersections for.
The circle intervals that form the intersection outline.
A matrix for remembering which circle intervals were always used.
The next partition or null
if no more can be found.
findOuterPartition
CircleIntersections
Static
findFind all connected outer path partitions.
The circles to find intersections for.
The determined interval sets (see findOuterCircleIntervals
).
An array of paths, each defined by a sequence of IndexPairs adressing circle i and interval j.
findOuterPartitions
CircleIntersections
Static
findFind all connected outer path partitions (as CircleSectors).
The circles to find intersections for.
The determined interval sets (see findOuterCircleIntervals
).
An array of paths, each defined by a sequence of SircleSectors.
findOuterPartitionsAsSectors
CircleIntersections
Static
Private
handlePrivate
This is a helper fuction used by findOuterCircleIntervals
.
It applies the passed radical line by intersecting the remaining circle sections with the new section.
The circles to find intersections for.
The radical line to apply.
The CircularIntervalSet to use (must have left and right border: 0 and 2*PI).
handleCircleInterval
CircleIntersections
Static
Private
radicalStatic
Private
randomPrivate
Pick a random unused circle interval. This function is used by the findOuterPartition
function, which
starts the detection with any random section.
An array of all available interval sets/intervals.
A matrix indicating which intervals have already been used/visited by the algorithm
randomUnusedInterval
CircleIntersections
Classdesc
A script for finding the intersection points of two or multiple circles (the 'radical lines').
Based on the C++ implementation by Robert King https://stackoverflow.com/questions/3349125/circle-circle-intersection-points and the 'Circles and spheres' article by Paul Bourke. http://paulbourke.net/geometry/circlesphere/
Requires
arrayFill
Requires
matrixFill
Requires
Circle
Requires
IndexPair
Requires
Matrix
Requires
Interval
Requires
Line
Requires
CirularIntervalSet