//class Point class Point { //PROPERTIES float x; float y; float z; Config conf; //CONSTRUCTORS, how to build a point Point () { this.conf = new Config(); // println("a point has been created"); } Point( float x, float y, float z ) { this.conf = new Config(); this.x = x; this.y = y; this.z = z; // setPosition(xPos, y); } //METHODS float getX() { return this.x; //more precise: return this.x; } float getY() { return this.y; } float getZ() { return this.z; } void setPosition(float x, float y, float z ) { this.x = x; this.y = y; this.z = z; } void drawYourself(float ratio) { Config conf = new Config(); fill(255); ellipse( this.x * ratio, this.y * ratio , conf.pointSize, conf.pointSize ); fill(0); } //returns the square of the distance to point float distanceSqr( Point point ) { float dx = point.getX() - this.getX(); float dy = point.getY() - this.getY(); return dx * dx + dy * dy; // pow( value, exp ); pow( dx, 2); } float distance( Point point ) { return sqrt( distanceSqr(point) ); } }