+
+ /** returns the next triangle walking clockwise around the vertex normal */
+ public T nextT(P p) { return prevE(p).other(this); }
+ public T prevT(P p) { return nextE(p).other(this); }
+
+ /** edge "after" this point, moving clockwise around the normal */
+ public E nextE(P p) {
+ if (p == e1.shared(e2)) return e1;
+ else if (p == e2.shared(e3)) return e2;
+ else if (p == e3.shared(e1)) return e3;
+ else throw new Error("triangle " + this + " does not own point " + p);
+ }
+
+ /** edge "before" this point, moving clockwise around the normal */
+ public E prevE(P p) {
+ if (p == e1.shared(e2)) return e2;
+ else if (p == e2.shared(e3)) return e3;
+ else if (p == e3.shared(e1)) return e1;
+ else throw new Error("triangle " + this + " does not own point " + p);
+ }
+
+ /** returns the angle at point p */
+ public double angle(P p) {
+ V v1 = nextE(p).other(p).minus(p);
+ V v2 = prevE(p).other(p).minus(p);
+ return Math.acos(v1.norm().dot(v2.norm()));
+ }
+