Beispiel #1
0
 Point PointInversion(Point P, Geodesic Geo)
 {
     if (Geo.IsLine)
     {
         return(Geo.L.Reflect(P));
     }
     return(PointInversion(P, Geo.C));
 }
Beispiel #2
0
        private int ReflectPoint(Geodesic geodesic, int pointIndex)
        {
            Point newP = PointInversion(Points[pointIndex], geodesic);

            var pt = Points.FindIndex(p => Math.Abs(p.X - newP.X) < 1e-6 && Math.Abs(p.Y - newP.Y) < 1e-6);

            if (pt >= 0)
            {
                return(pt);
            }
            var index = Points.Count;

            Points.Add(newP);
            return(index);
        }
        PathSegment HyperbolicLineSegment(Geodesic geodesic)
        {
            if (geodesic.IsLine)
            {
                return(new LineSegment(geodesic.B, true));
            }

            SweepDirection sweepDirection;

            if (Vector.AngleBetween(geodesic.A - geodesic.C.Center, geodesic.B - geodesic.C.Center) < 0)
            {
                sweepDirection = SweepDirection.Counterclockwise;
            }
            else
            {
                sweepDirection = SweepDirection.Clockwise;
            }

            return(new ArcSegment(geodesic.B, new Size(geodesic.C.Radius, geodesic.C.Radius), 0, false, sweepDirection, true));
        }