public E e1() { return e1; }
public E e2() { return e1.next; }
public E e3() { return e1.prev; }
- public Vec norm() { return v2().p.minus(v1().p).cross(v3().p.minus(v1().p)).norm(); }
public boolean hasE(E e) { return e1==e || e1.next==e || e1.prev==e; }
public boolean has(Vert v) { return v1()==v || v2()==v || v3()==v; }
- public float area() { return (float)Math.abs(0.5*e1().length()*new Vec(v1().p, v2().p).norm().dot(new Vec(v2().p, v3().p))); }
- public void glVertices(GL gl) {
- v1().p.glVertex(gl);
- v2().p.glVertex(gl);
- v3().p.glVertex(gl);
- }
- public Point centroid() {
- return new Point((v1().p.x+v2().p.x+v3().p.x)/3,
- (v1().p.y+v2().p.y+v3().p.y)/3,
- (v1().p.z+v2().p.z+v3().p.z)/3); }
- public float diameter() {
- // FIXME: what is this supposed to be?
- return Math.max(Math.max(e1().length(), e2().length()), e3().length()) / 2;
- }
}