package graphics; public class Spiral extends Shape { double turns = 1.5; //# of times spiral curls around public Spiral() { super(25, 2); wrap = false; } public Spiral(int newM, int newN) { super(newM, newN); wrap = false; } //convert u/v pair to xyz point protected double[] calculatePoint(double u, double v) { //point-normal pair double[] vertex = {0,0,0, 0,0,0, 0,0}; double theta = turns * 2 * Math.PI * u; vertex[0] = Math.exp(-u) * Math.cos(theta); //x vertex[1] = Math.exp(-u) * Math.sin(theta); //y vertex[2] = v; //z //vertex[3] = Math.cos(theta); //nx //vertex[4] = Math.sin(theta); //ny //vertex[5] = 0; //nz vertex[6] = u; vertex[7] = v; return vertex; } //gotta overwrite this b/c of casting issues :-/ public Object clone() { Spiral newSpiral = new Spiral(M, N); for (int i=0; i