Skip to content
Permalink
Browse files

Finished framework for main separator algorithm.

  • Loading branch information
Andrew Lawson Andrew Lawson
Andrew Lawson authored and Andrew Lawson committed Dec 1, 2014
1 parent b1f2827 commit 517ab551aae7ed16c6f8b552f0181ea1bfc09bdf
Showing with 18 additions and 0 deletions.
  1. +18 −0 geometric_separators.pde
@@ -118,6 +118,24 @@ void mousePressed() {
redraw();
}

// Get geometric separator
PShape getSeparator() {
// 1. Get centerpoint
PVector centerPoint = approxCenterpoint(rawInput);
// 2. Get random unit vector in 3D
PVector unitVector = PVector.Random3D();
// 3. Get radius
float radius = getRadius(centerPoint, unitVector);
// 4. Output sphere separator

}

// Get radius
float getRadius(PVector centerPoint, PVector unitVector) {
float num = (float)Math.sqrt(centerPoint.z - centerPoint.mag());
return num / Math.abs(unitVector.z);
}

// Get geometric median
PVector getGeometricMedian(ArrayList<PVector> input) {
if (input.size() == 0) {

0 comments on commit 517ab55

Please sign in to comment.
You can’t perform that action at this time.