Beispiel #1
0
        public Point[] IntersectLinePoints(Line line)
        {
            double a = Math.Pow(line.A, 2) + Math.Pow(line.B, 2);
            double b = 2 * (line.A * line.C - Center.X * Math.Pow(line.B, 2) + Center.Y * line.A * line.B);
            double c = Math.Pow(line.B * Center.X, 2) + Math.Pow(line.C, 2) + 2 * Center.Y * line.B * line.C + Math.Pow(Center.Y * line.B, 2) - Math.Pow(Radius * line.B, 2);

            List<Point> result = new List<Point>();
            foreach (double X in Calculating.QuadraticEquation(a, b, c))
            {
                double lineY = line.GetY(X);
                foreach (double Y in this.GetY(X))
                {

                    if (Calculating.DoubleEquals(Y, lineY))
                    {
                        result.Add(new Point(X, Y));
                    }
                }
            }
            return result.ToArray();
        }