Beispiel #1
0
        public Point[] GenerateLinearBezierCurve(Point p0, Point p1)
        {
            List <Point> bezierPoints = new List <Point>();

            //Generate apx value for delta t
            double dist   = p0.Distance(p1);
            double deltaT = 1 / dist;

            for (double t = 0; t <= 1; t += deltaT)
            {
                System.Windows.Point bezierPoint = BezierPoint(p0, p1, t);
                Point intPoint = bezierPoint.ToDrawingPoint();

                if (!bezierPoints.Contains(intPoint))
                {
                    bezierPoints.Add(intPoint);
                }
            }

            return(bezierPoints.ToArray());
        }