public static bool IsShorterThen(this IntPoint pointToCheck, long len) { if (pointToCheck.X > len || pointToCheck.X < -len) { return(false); } if (pointToCheck.Y > len || pointToCheck.Y < -len) { return(false); } return(pointToCheck.LengthSquared() <= len * len); }
public static long Length(this IntPoint pointToMeasure) { return((long)Math.Sqrt(pointToMeasure.LengthSquared())); }