Exemple #1
0
 public Sector(Circle2D circle2D, Point2D start, Point2D finish) : this()
 {
     if (PointOnCircle(start, circle2D) && PointOnCircle(finish, circle2D))
     {
         Finish = finish;
         Start = start;
         Circle = circle2D;
         Angle = new Triangle2D(Circle.Center, Start, Finish).AngleA;
         if (double.IsNaN(Angle.Radian))
             Angle = Angle.Zero;
         return;
     }
     throw new Exception("Не возможно создать сектор");
 }
Exemple #2
0
 private static bool PointOnCircle(Point2D point, Circle2D c)
 {
     const double epsilon = 0.000001;
     double actualyR = point.GetDistanceTo(c.Center);
     return (actualyR < c.R + epsilon && actualyR > c.R - epsilon);
 }