public static RoundData nullRoundData() { RoundData rd = new RoundData(); rd.IsNull = true; return(rd); }
public RoundData Copy() { if (nullCircle) { return(RoundData.nullRoundData()); } else { return(new RoundData(DCenterX, DCenterY, DRadius)); } }
/// <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); }
public static bool isNull(RoundData rd) { return(rd.IsNull); }