class Edge { color c = 0; Node n0, n1; float dx, dy; Edge(Node n0, Node n1) { this.n0 = n0; this.n1 = n1; n0.edges.add(this); n1.edges.add(this); } void paint(){ stroke(c); line(n0.x, n0.y, n1.x, n1.y); } float len() { return sqrt(sq(n0.x-n1.x)+sq(n0.y-n1.y)); } float dx() { return n1.x-n0.x; } float dy() { return n1.y-n0.y; } }