예제 #1
0
        private Point2d InternalGetFocus(bool primary)
        {
            double majrad = MajorRadius;
            double minrad = majrad * sigratio;
            double fdist  = Math.Sqrt(majrad * majrad - minrad * minrad);

            return(center.Polar(Rotation, fdist * (primary ? 1.0:-1.0)));
        }
예제 #2
0
        public override Point2d ClosestPoint(Point2d from)
        {
            if (Linear)
            {
                return(new Line2d(start, end).ClosestPoint(from));
            }

            Point2d ce     = Center;
            Point2d oncirc = ce.Polar(ce.Angle(from), Radius);

            if (IsCirclePointOnArc(oncirc))
            {
                return(oncirc);
            }

            return(from.ClosestPoint(start, end));
        }
예제 #3
0
 public override Point2d PointAt(double t)
 {
     return(center.Polar(t * MathUtil.Deg360, radius));
 }