/// <summary> /// Test if point is located inside bounding box. /// Currently only two dimensions are handled. /// </summary> /// <param name="boundingBox">Bounding box.</param> /// <param name='point'>Point.</param> /// <returns>True if point is located inside bounding box.</returns> public static Boolean IsPointInside(this WebBoundingBox boundingBox, WebPoint point) { return(boundingBox.IsNotNull() && point.IsNotNull() && (boundingBox.Max.X >= point.X) && (boundingBox.Min.X <= point.X) && (boundingBox.Max.Y >= point.Y) && (boundingBox.Min.Y <= point.Y)); }
/// <summary> /// Convert point to JSON format. /// </summary> /// <param name="point">Point that should be converted.</param> /// <returns>Point in JSON format.</returns> public static String GetJson(this WebPoint point) { if (point.IsNotNull()) { return("[" + point.X.WebToStringR() + ", " + point.Y.WebToStringR() + "]"); } else { return(String.Empty); } }
/// <summary> /// Check that data is valid. /// </summary> /// <param name="point">This point.</param> public static void CheckData(this WebPoint point) { if (point.IsNotNull()) { } }