Ejemplo n.º 1
0
        public static void MakeTriangles(Segment side, int length, int angle, out List <Triangle> tris)
        {
            tris = new List <Triangle>();

            // 1
            Segment newSide1  = side.ConstructSegmentByAngle(side.Point1, angle, length);
            Point   newPoint1 = newSide1.OtherPoint(side.Point1);

            tris.Add(new Triangle(side.Point1, side.Point2, newPoint1));

            // 2
            Segment newSide2  = side.ConstructSegmentByAngle(side.Point2, angle, length);
            Point   newPoint2 = newSide2.OtherPoint(side.Point2);

            tris.Add(new Triangle(side.Point1, side.Point2, newPoint2));

            // 3
            Point oppNewPoint1 = side.GetReflectionPoint(newPoint1);

            tris.Add(new Triangle(side.Point1, side.Point2, oppNewPoint1));

            // 4
            Point oppNewPoint2 = side.GetReflectionPoint(newPoint1);

            tris.Add(new Triangle(side.Point1, side.Point2, oppNewPoint2));
        }
Ejemplo n.º 2
0
        public static void MakeTriangles(Segment side, int length, int angle, out List<Triangle> tris)
        {
            tris = new List<Triangle>();

            // 1
            Segment newSide1 = side.ConstructSegmentByAngle(side.Point1, angle, length);
            Point newPoint1 = newSide1.OtherPoint(side.Point1);
            tris.Add(new Triangle(side.Point1, side.Point2, newPoint1));

            // 2
            Segment newSide2 = side.ConstructSegmentByAngle(side.Point2, angle, length);
            Point newPoint2 = newSide2.OtherPoint(side.Point2);
            tris.Add(new Triangle(side.Point1, side.Point2, newPoint2));

            // 3
            Point oppNewPoint1 = side.GetReflectionPoint(newPoint1);
            tris.Add(new Triangle(side.Point1, side.Point2, oppNewPoint1));

            // 4
            Point oppNewPoint2 = side.GetReflectionPoint(newPoint1);
            tris.Add(new Triangle(side.Point1, side.Point2, oppNewPoint2));
        }