コード例 #1
0
        public static RoundData nullRoundData()
        {
            RoundData rd = new RoundData();

            rd.IsNull = true;
            return(rd);
        }
コード例 #2
0
 public RoundData Copy()
 {
     if (nullCircle)
     {
         return(RoundData.nullRoundData());
     }
     else
     {
         return(new RoundData(DCenterX, DCenterY, DRadius));
     }
 }
コード例 #3
0
 /// <summary>
 /// Determines whether the testing point is inside the circle.
 /// </summary>
 /// <param name="pt">The testing point.</param>
 /// <param name="theCircle">The circle.</param>
 /// <returns>System.Int32:
 /// -1 => pt is outside the circle
 /// 0 => pt is at the circle margin
 /// 1 => pt is inside the circle
 /// default (for empty circle data) is outside
 /// </returns>
 public static int IsPointInsideCircle(this PointD pt, RoundData theCircle, double marginDetectorPrecision = 2.0d)
 {
     if (theCircle.IsNull)
     {
         return(-1);                  // default is outside
     }
     if (PointD.Distance(pt, theCircle.pointDCircleCenter()) < theCircle.DRadius)
     {
         return(1);
     }
     if (Math.Abs(PointD.Distance(pt, theCircle.pointDCircleCenter()) - theCircle.DRadius) <= marginDetectorPrecision)
     {
         return(0);
     }
     return(-1);
 }
コード例 #4
0
 public static bool isNull(RoundData rd)
 {
     return(rd.IsNull);
 }