- public E prevE(E e) {
- if (e==e2) return e3;
- if (e==e3) return e1;
- if (e==e1) return e2;
- throw new Error("triangle " + this + " does not own edge " + e);
- }
- // 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()));
- }
- */