Example #1
0
        public Tri CreateThreedian()
        {
            Point2 p01 = Points[0] + (Points[1] - Points[0]) * ((double)1 / 3);
            Point2 p12 = Points[1] + (Points[2] - Points[1]) * ((double)1 / 3);
            Point2 p20 = Points[2] + (Points[0] - Points[2]) * ((double)1 / 3);

            var planes = new HalfPlane[3];

            planes[0] = new HalfPlane(Points[0], p12);
            planes[1] = new HalfPlane(Points[1], p20);
            planes[2] = new HalfPlane(Points[2], p01);

            return(new Tri(planes));
        }
Example #2
0
        public FullTri(double x0, double y0, double x1, double y1, double x2, double y2)
        {
            Points[0] = new Point2(x0, y0);
            Points[1] = new Point2(x1, y1);
            Points[2] = new Point2(x2, y2);

            var planes = new HalfPlane[3];

            planes[0] = new HalfPlane(Points[0], Points[1]);
            planes[1] = new HalfPlane(Points[1], Points[2]);
            planes[2] = new HalfPlane(Points[2], Points[0]);

            Create(planes);

            PtMin = Point2.Min(Points[0], Points[1]);
            PtMin = Point2.Min(PtMin, Points[2]);

            PtMax = Point2.Max(Points[0], Points[1]);
            PtMax = Point2.Max(PtMax, Points[2]);
        }