示例#1
0
        public void Initialize(IRenderer renderer)
        {
            double x1x0 = points[1].X - points[0].X;
            double y1y0 = points[1].Y - points[0].Y;

            float a     = (float)(Math.Sqrt(x1x0 * x1x0 + y1y0 * y1y0) / 2.0);
            float b     = (float)(Math.Abs(y1y0 * points[2].X - x1x0 * points[2].Y + points[1].X * points[0].Y - points[1].Y * points[0].X) / Math.Sqrt(y1y0 * y1y0 + x1x0 * x1x0));
            float angle = (float)Math.Atan(y1y0 / x1x0);

            id = renderer.AddEllipse(Center, a, b, angle, color, borderColor, borderWidth);
        }