public static Section getFRhom(List<Section> sections, Vector vec) { foreach (Section section in sections) { if (section.Equals(vec)) return section; } return null; }
public Section(Vector vector, Triangle left, Triangle right) { this.Vector = vector; this.left = left; this.right = right; }
public Section(Vector vector) { this.Vector = vector; left = null; right = null; }
public double getDotMultiplication(Vector vector) { return dx * vector.dx + dy * vector.dy; }
public double getVectorMultiplication(Vector vector) { return dx * vector.dy - dy * vector.dx; }
public double getSumOfAngles(Point point) { Vector vecRight = new Vector(start, point); Vector vecLeft = new Vector(end, point); double angleRight = 180 * (Math.Acos(getDotMultiplication(vecRight) / (length * vecRight.Length))) / Math.PI; double angleLeft = 180 * (Math.Acos((new Vector(end, start).getDotMultiplication(vecLeft)) / (length * vecLeft.Length))) / Math.PI; return angleLeft + angleRight; }
public Vector getSum(Vector vector) { return new Vector(start, new Point(start.X + dx + vector.dx, start.Y + dy + vector.dy)); }