/// <summary> /// Aligns the specified polygon with its container (reference) polygon using the specified alignment. The container can be smaller than 'obj'. /// </summary> /// <param name="obj"></param> /// <param name="container"></param> /// <param name="align"></param> /// <returns></returns> public static PointF[] AlignWith(PointF[] obj, PointF[] container, ContentAlignment align) { RectangleF origBounds = PolygonMath.GetBoundingBox(obj); RectangleF newBounds = AlignWith(PolygonMath.GetBoundingBox(obj), PolygonMath.GetBoundingBox(container), align); return(PolygonMath.MovePoly(obj, new PointF(newBounds.X - origBounds.X, newBounds.Y - origBounds.Y))); }
public static RotateFlipType combineFlipAndRotate(RotateFlipType flip, double angle) { return(PolygonMath.CombineFlipAndRotate(flip, angle)); }
/// <summary> /// Moves the polygon so that the upper-left corner of its bounding box is located at 0,0. /// </summary> /// <param name="poly"></param> /// <returns></returns> public static PointF[] NormalizePoly(PointF[] poly) { RectangleF box = GetBoundingBox(poly); return(PolygonMath.MovePoly(poly, new PointF(-box.X, -box.Y))); }
public static double normalizeTo90Intervals(double d) { return(PolygonMath.NormalizeTo90Intervals(d)); }