function spiral (CoordinateSystem cs, int count, double radius, double heightStep) { Point spiralP = {}; double radiusInt = 0.0; for (int i = 0; i < count; ++i) { spiralP[i] = new Point(); radiusInternal=radius*(1-Pow(i/count,0.5)); spiralP[i].ByCylindricalCoordinates(cs, radiusInternal, 30.0*i, i*heightStep); } return spiralP; };

function parabola(CoordinateSystem cs, int count, double scale) { Point pointOnParabola = {}; for (int i=0; i < count+1; ++i){ pointOnParabola[i] = new Point(); pointOnParabola[i].ByCartesianCoords(cs,i,0.0,scale*i*i); } return pointOnParabola; };

function parabolaInRange(CoordinateSystem cs, int count, double scale, double range) { Point pointOnParabola = {}; double xStep = Sqrt(range/scale)/count; double x = 0.0; for (int i=0; i < count+1; ++i){ x = i*xStep; pointOnParabola[i] = new Point(); pointOnParabola[i].ByCartesianCoords(cs,x,0.0,scale*x*x); } return pointOnParabola; };

function wave (CoordinateSystem cs, int count, double size, double amplitude, double angleStart) { Point pt = {}; double anglei = 0.0; double anglej = 0.0; double ordinate = 0.0; for (int i = 0; i<=count; ++i) { pt[i] = {}; anglei = (i/count)*360 + angleStart; for (int j = 0; j <count; ++j) { pt[i][j] = new Point(); anglej = (j/count)*360 + angleStart; ordinate = Sin(anglei) + Sin(anglej))*amplitude/2; pt[i][j].ByCartesianCoordinates(cs, (j/count*size), (i/count*size), ordinate); } } return pt; };

function cloud (CoordinateSystem lowerLeft, int count, double boundX, double boundY, double boundZ) { Point randomP = {}; for (int i = 0; i < count; ++i) { randomP[i] = new Point(); randomP[i].ByCartesianCoords(lowerLeft, Random(0.0,boundX), Random(0.0,boundY), Random(0.0,boundZ)); } return randomP; };

function pointOnCurve (Curve curve, int count) { Point p = {}; double tStep = 1/(count-1); for (int i = 0; i < count; i++) { p[i]=new Point(); p[i].ByTParameter(curve, i*tStep); } return p; };

function pointOnSurface (Surface surface, int uCount, int vCount) { Point p = {}; double uStep = 1/(uCount-1); double vStep = 1/(vCount-1); for (int i = 0; i < uCount; i++) { p[i]={}; for (int j = 0; j < vCount; j++) { p[i][j]=new Point(); p[i][j].ByUVParameters(surface, i*uStep, j*vStep); } } return p; };