diff --git a/java/examples/Basics/Form/BezierEllipse/BezierEllipse.pde b/java/examples/Basics/Form/BezierEllipse/BezierEllipse.pde deleted file mode 100644 index b079c6f56..000000000 --- a/java/examples/Basics/Form/BezierEllipse/BezierEllipse.pde +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Bezier Ellipse - * By Ira Greenberg - * - * Generates an ellipse using bezier() and - * trig functions. Approximately every 1/2 - * second a new ellipse is plotted using - * random values for control/anchor points. - */ - -// arrays to hold ellipse coordinate data -float[] px, py, cx, cy, cx2, cy2; - -// global variable-points in ellipse -int pts = 4; - -color controlPtCol = #222222; -color anchorPtCol = #BBBBBB; - -void setup(){ - size(640, 360); - setEllipse(pts, 65, 65); - frameRate(1); -} - -void draw(){ - background(145); - drawEllipse(); - setEllipse(int(random(3, 12)), random(-100, 150), random(-100, 150)); -} - -// Draw ellipse with anchor/control points -void drawEllipse(){ - strokeWeight(1.125); - stroke(255); - noFill(); - // Create ellipse - for (int i=0; i0){ - line(px[i], py[i], cx2[i-1], cy2[i-1]); - } - line(px[i], py[i], cx[i], cy[i]); - } - - for ( int i=0; i< pts; i++){ - fill(controlPtCol); - noStroke(); - // Control handles - ellipse(cx[i], cy[i], 4, 4); - ellipse(cx2[i], cy2[i], 4, 4); - - fill(anchorPtCol); - stroke(0); - // Anchor points - rect(px[i], py[i], 5, 5); - } -} - -// Fill arrays with ellipse coordinate data -void setEllipse(int points, float radius, float controlRadius){ - pts = points; - px = new float[points]; - py = new float[points]; - cx = new float[points]; - cy = new float[points]; - cx2 = new float[points]; - cy2 = new float[points]; - float angle = 360.0/points; - float controlAngle1 = angle/3.0; - float controlAngle2 = controlAngle1*2.0; - for ( int i=0; i