public static DependentPolygon dTriangle(InteractableLineSegment lineSegment, AbstractPoint point) { List <AbstractPoint> pointList = new List <AbstractPoint>() { point, lineSegment.point1, lineSegment.point2 }; List <AbstractLineSegment> lineList = new List <AbstractLineSegment>() { lineSegment, dLineSegment(point, lineSegment.point1), dLineSegment(point, lineSegment.point2) }; return(dPolygon(lineList, pointList)); }
internal static InteractablePolygon iTriangle(InteractableLineSegment lineSegment, AbstractPoint point) { List <AbstractPoint> pointList = new List <AbstractPoint>() { point, lineSegment.point1, lineSegment.point2 }; List <AbstractLineSegment> lineList = new List <AbstractLineSegment>() { lineSegment, dLineSegment(point, lineSegment.point1), dLineSegment(point, lineSegment.point2) }; return(iPolygon(lineList, pointList)); }
public static InteractableLineSegment iLineSegment(AbstractPoint point1, AbstractPoint point2) { InteractableLineSegment line = InteractableLineSegment.Constructor(); line.point1 = point1; line.point2 = point2; line.vertex0 = point1.Position3; line.vertex1 = point2.Position3; line.transform.GetComponent <InteractableLineSegment>().InitializeFigure(); HW_GeoSolver.ins.addComponent(line); HW_GeoSolver.ins.AddDependence(line, point1); HW_GeoSolver.ins.AddDependence(line, point2); return(line); }
internal static InteractablePrism iPrism(List <AbstractLineSegment> edges) { InteractablePrism prism = InteractablePrism.Constructor(); prism.bases = new List <AbstractPolygon>(); prism.sides = new List <AbstractPolygon>(); prism.lineSegments = edges; foreach (AbstractLineSegment line in edges) { if (line.GetComponent <InteractableLineSegment>() != null) { InteractableLineSegment iLineSegment = line.GetComponent <InteractableLineSegment>(); if (!prism.vertexPoints.Contains(iLineSegment.point1)) { prism.vertexPoints.Add(iLineSegment.point1); } if (!prism.vertexPoints.Contains(iLineSegment.point2)) { prism.vertexPoints.Add(iLineSegment.point2); } } else if (line.GetComponent <DependentLineSegment>() != null) { DependentLineSegment dlineSegment = line.GetComponent <DependentLineSegment>(); if (!prism.vertexPoints.Contains(dlineSegment.point1)) { prism.vertexPoints.Add(dlineSegment.point1); } if (!prism.vertexPoints.Contains(dlineSegment.point2)) { prism.vertexPoints.Add(dlineSegment.point2); } } } prism.lineSegments.ForEach(l => HW_GeoSolver.ins.AddDependence(prism, l)); prism.vertexPoints.ForEach(p => HW_GeoSolver.ins.AddDependence(prism, p)); prism.InitializeFigure(); return(prism); }