protected override Polygon GetPolygon()
        {
            Polygon poly = new Polygon(GetPoints());

            if (thickness > 1)
            {
                List <PolygonPoint> points = GetPoints();
                Vector2             center = GetCentroid(points);
                float[]             angles = { TriangleHelper2D.AngleA(a, b, c), TriangleHelper2D.AngleB(a, b, c), TriangleHelper2D.AngleC(a, b, c) };
                int count = points.Count;

                for (int i = count; --i >= 0;)
                {
                    PolygonPoint point = points[i];

                    double vecX   = center.X - point.X;
                    double vecY   = center.Y - point.Y;
                    double invLen = 1d / Math.Sqrt((vecX * vecX) + (vecY * vecY));
                    vecX = vecX * invLen;
                    vecY = vecY * invLen;

                    float ratio          = 1 - (angles[i] / 180);
                    float angleThickness = ratio * thickness;
                    point.X += vecX * angleThickness;
                    point.Y += vecY * angleThickness;
                }

                Polygon hole = new Polygon(points);
                poly.AddHole(hole);
            }

            return(poly);
        }
 public PTriangle(Vector2 a, float lengthAB, float angleB, uint thickness)
     : base(thickness)
 {
     if (angleB >= 180)
     {
         throw new ArgumentException("Angle cannot be greater than or equal to 180.");
     }
     this.position = a;
     this.a        = a;
     this.b        = new Vector2(a.X + lengthAB, a.Y);
     this.c        = b + TriangleHelper2D.RadianToVector(MathUtil.DegreesToRadians(angleB) - MathUtil.PiOverTwo) * lengthAB;
 }