com.io7m.jregions.core.parameterized.areas

## Class PAreasF

- java.lang.Object
- - com.io7m.jregions.core.parameterized.areas.PAreasF

-     public final class PAreasF
      extends Object

  Functions over areas.

  These functions operate using the concepts of minimum-x, maximum-x, minimum-y, and maximum-y edges. It is up to individual applications to assign meaning to these edges such as "left" for minimum-x and "top" for minimum-y.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <S> PAreaF<S>` | `alignCenter(PAreaF<S> outer, PAreaF<S> inner)` Align the area `inner` such that the center of the area is equal to the center of `outer`.
    `static <S> PAreaF<S>` | `alignHorizontallyCenter(PAreaF<S> outer, PAreaF<S> inner)` Align the area `inner` horizontally in the center of `outer`.
    `static <S> PAreaF<S>` | `alignHorizontallyMaxX(PAreaF<S> outer, PAreaF<S> inner)` Equivalent to calling `alignHorizontallyMaxXOffset(PAreaF, PAreaF, float)` with a zero offset.
    `static <S> PAreaF<S>` | `alignHorizontallyMaxXOffset(PAreaF<S> outer, PAreaF<S> inner, float offset)` Align the area `inner` horizontally against the inside maximum-x edge of `outer`.
    `static <S> PAreaF<S>` | `alignHorizontallyMinX(PAreaF<S> outer, PAreaF<S> inner)` Equivalent to calling `alignHorizontallyMinXOffset(PAreaF, PAreaF, float)` with a zero offset.
    `static <S> PAreaF<S>` | `alignHorizontallyMinXOffset(PAreaF<S> outer, PAreaF<S> inner, float offset)` Align the area `inner` horizontally against the inside minimum-x edge of `outer`.
    `static <S> PAreaF<S>` | `alignMaxYMaxX(PAreaF<S> outer, PAreaF<S> inner)` Equivalent to calling `alignMaxYMaxXOffset(PAreaF, PAreaF, float, float)` with zero offsets.
    `static <S> PAreaF<S>` | `alignMaxYMaxXOffset(PAreaF<S> outer, PAreaF<S> inner, float offset_x, float offset_y)` Align the area `inner` such that the maximum-y edge is at least `offset_y` from the inside maximum-y edge of `outer` and the maximum-x edge is at least `offset_x` from the inside maximum-x edge of `outer`.
    `static <S> PAreaF<S>` | `alignMaxYMinX(PAreaF<S> outer, PAreaF<S> inner)` Equivalent to calling `alignMaxYMinXOffset(PAreaF, PAreaF, float, float)` with zero offsets.
    `static <S> PAreaF<S>` | `alignMaxYMinXOffset(PAreaF<S> outer, PAreaF<S> inner, float offset_x, float offset_y)` Align the area `inner` such that the maximum-y edge is at least `offset_y` from the inside maximum-y edge of `outer` and the minimum-x edge is at least `offset_x` from the inside minimum-x edge of `outer`.
    `static <S> PAreaF<S>` | `alignMinYMaxX(PAreaF<S> outer, PAreaF<S> inner)` Equivalent to calling `alignMinYMaxXOffset(PAreaF, PAreaF, float, float)` with zero offsets.
    `static <S> PAreaF<S>` | `alignMinYMaxXOffset(PAreaF<S> outer, PAreaF<S> inner, float offset_x, float offset_y)` Align the area `inner` such that the minimum-y edge is at least `offset_y` from the inside minimum-y edge of `outer` and the maximum-x edge is at least `offset_x` from the inside maximum-x edge of `outer`.
    `static <S> PAreaF<S>` | `alignMinYMinX(PAreaF<S> outer, PAreaF<S> inner)` Equivalent to calling `alignMinYMinXOffset(PAreaF, PAreaF, float, float)` with zero offsets.
    `static <S> PAreaF<S>` | `alignMinYMinXOffset(PAreaF<S> outer, PAreaF<S> inner, float offset_x, float offset_y)` Align the area `inner` such that the minimum-y edge is at least `offset_y` from the inside minimum-y edge of `outer` and the minimum-x edge is at least `offset_x` from the inside minimum-x edge of `outer`.
    `static <S> PAreaF<S>` | `alignVerticallyCenter(PAreaF<S> outer, PAreaF<S> inner)` Align the area `inner` vertically in the center of `outer`.
    `static <S> PAreaF<S>` | `alignVerticallyMaxY(PAreaF<S> outer, PAreaF<S> inner)` Equivalent to calling `alignVerticallyMaxYOffset(PAreaF, PAreaF, float)` with a zero offset.
    `static <S> PAreaF<S>` | `alignVerticallyMaxYOffset(PAreaF<S> outer, PAreaF<S> inner, float offset)` Align the area `inner` vertically against the inside maximum-y edge of `outer`.
    `static <S> PAreaF<S>` | `alignVerticallyMinY(PAreaF<S> outer, PAreaF<S> inner)` Equivalent to calling `alignVerticallyMinYOffset(PAreaF, PAreaF, float)` with a zero offset.
    `static <S> PAreaF<S>` | `alignVerticallyMinYOffset(PAreaF<S> outer, PAreaF<S> inner, float offset)` Align the area `inner` vertically against the inside minimum-y edge of `outer`.
    `static <S,T> PAreaF<T>` | `cast(PAreaF<S> area)` Brand a given area as belonging to a different coordinate space.
    `static <S> PAreaF<S>` | `containing(PAreaF<S> a, PAreaF<S> b)` Construct a area that will contain both `a` and `b`.
    `static <S> boolean` | `contains(PAreaF<S> a, PAreaF<S> b)` Determine whether or not one area contains another.
    `static <S> boolean` | `containsPoint(PAreaF<S> a, float x, float y)` Determine whether or not a area contains a given point.
    `static <S> boolean` | `couldFitInside(PAreaF<S> a, PAreaF<S> b)` Determine whether or not one area could fit inside another.
    `static <S> PAreaF<S>` | `create(float x, float y, float width, float height)` Create an area of width `width` and height `height`, placing the minimum corner at `(x, y)`.
    `static <S> PAreaF<S>` | `fitBetweenHorizontal(PAreaF<S> fit, PAreaF<S> a, PAreaF<S> b)` Attempt to fit `fit` between `a` and `b`, horizontally.
    `static <S> PAreaF<S>` | `fitBetweenVertical(PAreaF<S> fit, PAreaF<S> a, PAreaF<S> b)` Attempt to fit `fit` between `a` and `b`, vertically.
    `static <S> PAreaF<S>` | `hollowOut(PAreaF<S> outer, float min_x_offset, float max_x_offset, float min_y_offset, float max_y_offset)` Construct a new area that fits inside `outer` based on the given offsets from each edge.
    `static <S> PAreaF<S>` | `hollowOutEvenly(PAreaF<S> outer, float offset)` Equivalent to calling `hollowOut(PAreaF, float, float, float, float)` with `offset` for all offset parameters.
    `static <S> PAreaF<S>` | `moveAbsolute(PAreaF<S> area, float x, float y)` Move the given area to `(x, y)`.
    `static <S> PAreaF<S>` | `moveRelative(PAreaF<S> area, float x, float y)` Move the given area by `(x, y)`.
    `static <S> PAreaF<S>` | `moveToOrigin(PAreaF<S> area)` Move the given area to `(0, 0)`.
    `static <S> boolean` | `overlaps(PAreaF<S> a, PAreaF<S> b)` Determine whether or not two areas overlap.
    `static <S> PAreaF<S>` | `scaleFromCenter(PAreaF<S> area, float x_diff, float y_diff)` Scale `area` by adding `x_diff` to the width, and `y_diff` to the height.
    `static <S> PAreaF<S>` | `scaleFromMaxYMaxX(PAreaF<S> area, float x_diff, float y_diff)` Scale `area` by adding `x_diff` to the width, and `y_diff` to the height.
    `static <S> PAreaF<S>` | `scaleFromMaxYMinX(PAreaF<S> area, float x_diff, float y_diff)` Scale `area` by adding `x_diff` to the width, and `y_diff` to the height.
    `static <S> PAreaF<S>` | `scaleFromMinYMaxX(PAreaF<S> area, float x_diff, float y_diff)` Scale `area` by adding `x_diff` to the width, and `y_diff` to the height.
    `static <S> PAreaF<S>` | `scaleFromMinYMinX(PAreaF<S> area, float x_diff, float y_diff)` Scale `area` by adding `x_diff` to the width, and `y_diff` to the height.
    `static <S> PAreaF<S>` | `setSizeFromCenter(PAreaF<S> area, float width, float height)` Set the width and height of `area` to `width` and `height`, respectively.
    `static <S> PAreaF<S>` | `setSizeFromMaxYMaxX(PAreaF<S> area, float width, float height)` Set the width and height of `area` to `width` and `height`, respectively.
    `static <S> PAreaF<S>` | `setSizeFromMaxYMinX(PAreaF<S> area, float width, float height)` Set the width and height of `area` to `width` and `height`, respectively.
    `static <S> PAreaF<S>` | `setSizeFromMinYMaxX(PAreaF<S> area, float width, float height)` Set the width and height of `area` to `width` and `height`, respectively.
    `static <S> PAreaF<S>` | `setSizeFromMinYMinX(PAreaF<S> area, float width, float height)` Set the width and height of `area` to `width` and `height`, respectively.
    `static <S> String` | `show(PAreaF<S> area)`
    `static <S> String` | `showToBuilder(PAreaF<S> area, StringBuilder sb)`
    `static <S> PAreaSizeF<S>` | `size(PAreaF<S> area)`
    `static <S> PAreaXSplitF<S,PAreaF<S>>` | `splitAlongParallelToX(PAreaF<S> area, float y)` Split `area` along a line parallel to the X axis placed at `y` units from its own minimum-y edge.
    `static <S> PAreaYSplitF<S,PAreaF<S>>` | `splitAlongParallelToY(PAreaF<S> area, float x)` Split `area` along a line parallel to the Y axis placed at `x` units from its own minimum-x edge.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### create

          public static <S> PAreaF<S> create(float x,
                                             float y,
                                             float width,
                                             float height)

      Create an area of width `width` and height `height`, placing the minimum corner at `(x, y)`.
      Type Parameters:
        `S` - The coordinate space of the area
      Parameters:
        `x` - The X value of the minimum corner
        `y` - The Y value of the minimum corner
        `width` - The width of the area
        `height` - The height of the area
      Returns:
        An area

    - #### contains

          public static <S> boolean contains(PAreaF<S> a,
                                             PAreaF<S> b)

      Determine whether or not one area contains another.

      Containing is reflexive: `contains(a, a) == true`.

      Containing is transitive: `contains(a, b) → contains(b, c) → contains(a, c)`.

      Containing is not necessarily symmetric.

      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `a` - Area A
        `b` - Area B
      Returns:
        `true` iff `a` contains `b`

    - #### moveRelative

          public static <S> PAreaF<S> moveRelative(PAreaF<S> area,
                                                   float x,
                                                   float y)

      Move the given area by `(x, y)`.
      Type Parameters:
        `S` - The coordinate space of the area
      Parameters:
        `area` - The area
        `x` - The amount to move on the X axis
        `y` - The amount to move on the Y axis
      Returns:
        A moved area

    - #### moveAbsolute

          public static <S> PAreaF<S> moveAbsolute(PAreaF<S> area,
                                                   float x,
                                                   float y)

      Move the given area to `(x, y)`.
      Type Parameters:
        `S` - The coordinate space of the area
      Parameters:
        `area` - The area
        `x` - The position to which to move on the X axis
        `y` - The position to which to move on the Y axis
      Returns:
        A moved area

    - #### moveToOrigin

          public static <S> PAreaF<S> moveToOrigin(PAreaF<S> area)

      Move the given area to `(0, 0)`.
      Type Parameters:
        `S` - The coordinate space of the area
      Parameters:
        `area` - The area
      Returns:
        A moved area

    - #### cast

          public static <S,T> PAreaF<T> cast(PAreaF<S> area)

      Brand a given area as belonging to a different coordinate space. Mixing up coordinate spaces is a common source of difficult-to-locate bugs. Use at your own risk.
      Type Parameters:
        `S` - The starting coordinate space
        `T` - The resulting coordinate space
      Parameters:
        `area` - An area
      Returns:
        `area`

    - #### alignHorizontallyCenter

          public static <S> PAreaF<S> alignHorizontallyCenter(PAreaF<S> outer,
                                                              PAreaF<S> inner)

      Align the area `inner` horizontally in the center of `outer`.
      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
      Returns:
        An aligned area

    - #### alignHorizontallyMinX

          public static <S> PAreaF<S> alignHorizontallyMinX(PAreaF<S> outer,
                                                            PAreaF<S> inner)

      Equivalent to calling `alignHorizontallyMinXOffset(PAreaF, PAreaF, float)` with a zero offset.
      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
      Returns:
        An aligned area

    - #### alignHorizontallyMinXOffset

          public static <S> PAreaF<S> alignHorizontallyMinXOffset(PAreaF<S> outer,
                                                                  PAreaF<S> inner,
                                                                  float offset)

      Align the area `inner` horizontally against the inside minimum-x edge of `outer`. The area will be at least `offset` units from the minimum-x edge.
      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
        `offset` - The offset from the edge
      Returns:
        An aligned area

    - #### alignHorizontallyMaxX

          public static <S> PAreaF<S> alignHorizontallyMaxX(PAreaF<S> outer,
                                                            PAreaF<S> inner)

      Equivalent to calling `alignHorizontallyMaxXOffset(PAreaF, PAreaF, float)` with a zero offset.
      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
      Returns:
        An aligned area

    - #### alignHorizontallyMaxXOffset

          public static <S> PAreaF<S> alignHorizontallyMaxXOffset(PAreaF<S> outer,
                                                                  PAreaF<S> inner,
                                                                  float offset)

      Align the area `inner` horizontally against the inside maximum-x edge of `outer`. The area will be at least `offset` units from the maximum-x edge.
      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
        `offset` - The offset from the edge
      Returns:
        An aligned area

    - #### alignVerticallyMinY

          public static <S> PAreaF<S> alignVerticallyMinY(PAreaF<S> outer,
                                                          PAreaF<S> inner)

      Equivalent to calling `alignVerticallyMinYOffset(PAreaF, PAreaF, float)` with a zero offset.
      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
      Returns:
        An aligned area

    - #### alignVerticallyMinYOffset

          public static <S> PAreaF<S> alignVerticallyMinYOffset(PAreaF<S> outer,
                                                                PAreaF<S> inner,
                                                                float offset)

      Align the area `inner` vertically against the inside minimum-y edge of `outer`. The area will be at least `offset` units from the minimum-y edge.
      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
        `offset` - The offset from the edge
      Returns:
        An aligned area

    - #### alignVerticallyMaxY

          public static <S> PAreaF<S> alignVerticallyMaxY(PAreaF<S> outer,
                                                          PAreaF<S> inner)

      Equivalent to calling `alignVerticallyMaxYOffset(PAreaF, PAreaF, float)` with a zero offset.
      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
      Returns:
        An aligned area

    - #### alignVerticallyMaxYOffset

          public static <S> PAreaF<S> alignVerticallyMaxYOffset(PAreaF<S> outer,
                                                                PAreaF<S> inner,
                                                                float offset)

      Align the area `inner` vertically against the inside maximum-y edge of `outer`. The area will be at least `offset` units from the maximum-y edge.
      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
        `offset` - The offset from the edge
      Returns:
        An aligned area

    - #### alignVerticallyCenter

          public static <S> PAreaF<S> alignVerticallyCenter(PAreaF<S> outer,
                                                            PAreaF<S> inner)

      Align the area `inner` vertically in the center of `outer`.
      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
      Returns:
        An aligned area

    - #### alignMinYMinX

          public static <S> PAreaF<S> alignMinYMinX(PAreaF<S> outer,
                                                    PAreaF<S> inner)

      Equivalent to calling `alignMinYMinXOffset(PAreaF, PAreaF, float, float)` with zero offsets.
      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
      Returns:
        An aligned area

    - #### alignMinYMinXOffset

          public static <S> PAreaF<S> alignMinYMinXOffset(PAreaF<S> outer,
                                                          PAreaF<S> inner,
                                                          float offset_x,
                                                          float offset_y)

      Align the area `inner` such that the minimum-y edge is at least `offset_y` from the inside minimum-y edge of `outer` and the minimum-x edge is at least `offset_x` from the inside minimum-x edge of `outer`.
      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
        `offset_x` - The offset from the minimum-x edge
        `offset_y` - The offset from the minimum-y edge
      Returns:
        An aligned area

    - #### alignMinYMaxX

          public static <S> PAreaF<S> alignMinYMaxX(PAreaF<S> outer,
                                                    PAreaF<S> inner)

      Equivalent to calling `alignMinYMaxXOffset(PAreaF, PAreaF, float, float)` with zero offsets.
      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
      Returns:
        An aligned area

    - #### alignMinYMaxXOffset

          public static <S> PAreaF<S> alignMinYMaxXOffset(PAreaF<S> outer,
                                                          PAreaF<S> inner,
                                                          float offset_x,
                                                          float offset_y)

      Align the area `inner` such that the minimum-y edge is at least `offset_y` from the inside minimum-y edge of `outer` and the maximum-x edge is at least `offset_x` from the inside maximum-x edge of `outer`.
      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
        `offset_x` - The offset from the maximum-x edge
        `offset_y` - The offset from the minimum-y edge
      Returns:
        An aligned area

    - #### alignMaxYMinX

          public static <S> PAreaF<S> alignMaxYMinX(PAreaF<S> outer,
                                                    PAreaF<S> inner)

      Equivalent to calling `alignMaxYMinXOffset(PAreaF, PAreaF, float, float)` with zero offsets.
      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
      Returns:
        An aligned area

    - #### alignMaxYMinXOffset

          public static <S> PAreaF<S> alignMaxYMinXOffset(PAreaF<S> outer,
                                                          PAreaF<S> inner,
                                                          float offset_x,
                                                          float offset_y)

      Align the area `inner` such that the maximum-y edge is at least `offset_y` from the inside maximum-y edge of `outer` and the minimum-x edge is at least `offset_x` from the inside minimum-x edge of `outer`.
      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
        `offset_x` - The offset from the minimum-x edge
        `offset_y` - The offset from the maximum-y edge
      Returns:
        An aligned area

    - #### alignMaxYMaxX

          public static <S> PAreaF<S> alignMaxYMaxX(PAreaF<S> outer,
                                                    PAreaF<S> inner)

      Equivalent to calling `alignMaxYMaxXOffset(PAreaF, PAreaF, float, float)` with zero offsets.
      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
      Returns:
        An aligned area

    - #### alignMaxYMaxXOffset

          public static <S> PAreaF<S> alignMaxYMaxXOffset(PAreaF<S> outer,
                                                          PAreaF<S> inner,
                                                          float offset_x,
                                                          float offset_y)

      Align the area `inner` such that the maximum-y edge is at least `offset_y` from the inside maximum-y edge of `outer` and the maximum-x edge is at least `offset_x` from the inside maximum-x edge of `outer`.
      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
        `offset_x` - The offset from the maximum-x edge
        `offset_y` - The offset from the maximum-y edge
      Returns:
        An aligned area

    - #### alignCenter

          public static <S> PAreaF<S> alignCenter(PAreaF<S> outer,
                                                  PAreaF<S> inner)

      Align the area `inner` such that the center of the area is equal to the center of `outer`.
      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
      Returns:
        An aligned area

    - #### hollowOut

          public static <S> PAreaF<S> hollowOut(PAreaF<S> outer,
                                                float min_x_offset,
                                                float max_x_offset,
                                                float min_y_offset,
                                                float max_y_offset)

      Construct a new area that fits inside `outer` based on the given offsets from each edge.
      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `outer` - The containing area
        `min_x_offset` - The offset from the minimum-x edge (must be non-negative)
        `max_x_offset` - The offset from the maximum-x edge (must be non-negative)
        `min_y_offset` - The offset from the minimum-y edge (must be non-negative)
        `max_y_offset` - The offset from the maximum-y edge (must be non-negative)
      Returns:
        A new area

    - #### hollowOutEvenly

          public static <S> PAreaF<S> hollowOutEvenly(PAreaF<S> outer,
                                                      float offset)

      Equivalent to calling `hollowOut(PAreaF, float, float, float, float)` with `offset` for all offset parameters.
      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `outer` - The containing area
        `offset` - The offset from each edge (must be non-negative)
      Returns:
        A new area

    - #### setSizeFromCenter

          public static <S> PAreaF<S> setSizeFromCenter(PAreaF<S> area,
                                                        float width,
                                                        float height)

      Set the width and height of `area` to `width` and `height`, respectively.

      The area is resized from its own center.

      Type Parameters:
        `S` - The coordinate space of the area
      Parameters:
        `area` - The area
        `width` - The new width (must be non-negative)
        `height` - The new height (must be non-negative)
      Returns:
        A resized area

    - #### setSizeFromMinYMinX

          public static <S> PAreaF<S> setSizeFromMinYMinX(PAreaF<S> area,
                                                          float width,
                                                          float height)

      Set the width and height of `area` to `width` and `height`, respectively.

      The area is resized by moving its minimum-y-minimum-x corner.

      Type Parameters:
        `S` - The coordinate space of the area
      Parameters:
        `area` - The area
        `width` - The new width (must be non-negative)
        `height` - The new height (must be non-negative)
      Returns:
        A resized area

    - #### setSizeFromMinYMaxX

          public static <S> PAreaF<S> setSizeFromMinYMaxX(PAreaF<S> area,
                                                          float width,
                                                          float height)

      Set the width and height of `area` to `width` and `height`, respectively.

      The area is resized by moving its minimum-y-maximum-x corner.

      Type Parameters:
        `S` - The coordinate space of the area
      Parameters:
        `area` - The area
        `width` - The new width (must be non-negative)
        `height` - The new height (must be non-negative)
      Returns:
        A resized area

    - #### setSizeFromMaxYMaxX

          public static <S> PAreaF<S> setSizeFromMaxYMaxX(PAreaF<S> area,
                                                          float width,
                                                          float height)

      Set the width and height of `area` to `width` and `height`, respectively.

      The area is resized by moving its maximum-y-maximum-x corner.

      Type Parameters:
        `S` - The coordinate space of the area
      Parameters:
        `area` - The area
        `width` - The new width (must be non-negative)
        `height` - The new height (must be non-negative)
      Returns:
        A resized area

    - #### setSizeFromMaxYMinX

          public static <S> PAreaF<S> setSizeFromMaxYMinX(PAreaF<S> area,
                                                          float width,
                                                          float height)

      Set the width and height of `area` to `width` and `height`, respectively.

      The area is resized by moving its maximum-y-minimum-x corner.

      Type Parameters:
        `S` - The coordinate space of the area
      Parameters:
        `area` - The area
        `width` - The new width (must be non-negative)
        `height` - The new height (must be non-negative)
      Returns:
        A resized area

    - #### scaleFromMinYMinX

          public static <S> PAreaF<S> scaleFromMinYMinX(PAreaF<S> area,
                                                        float x_diff,
                                                        float y_diff)

      Scale `area` by adding `x_diff` to the width, and `y_diff` to the height. The size of the resulting area is clamped so that its width and height are always non-negative.

      The area is resized by moving its minimum-y-minimum-x corner.

      Type Parameters:
        `S` - The coordinate space of the area
      Parameters:
        `area` - The area
        `x_diff` - The X difference
        `y_diff` - The Y difference
      Returns:
        A resized area

    - #### scaleFromMinYMaxX

          public static <S> PAreaF<S> scaleFromMinYMaxX(PAreaF<S> area,
                                                        float x_diff,
                                                        float y_diff)

      Scale `area` by adding `x_diff` to the width, and `y_diff` to the height. The size of the resulting area is clamped so that its width and height are always non-negative.

      The area is resized by moving its minimum-y-maximum-x corner.

      Type Parameters:
        `S` - The coordinate space of the area
      Parameters:
        `area` - The area
        `x_diff` - The X difference
        `y_diff` - The Y difference
      Returns:
        A resized area

    - #### scaleFromMaxYMinX

          public static <S> PAreaF<S> scaleFromMaxYMinX(PAreaF<S> area,
                                                        float x_diff,
                                                        float y_diff)

      Scale `area` by adding `x_diff` to the width, and `y_diff` to the height. The size of the resulting area is clamped so that its width and height are always non-negative.

      The area is resized by moving its maximum-y-minimum-x corner.

      Type Parameters:
        `S` - The coordinate space of the area
      Parameters:
        `area` - The area
        `x_diff` - The X difference
        `y_diff` - The Y difference
      Returns:
        A resized area

    - #### scaleFromMaxYMaxX

          public static <S> PAreaF<S> scaleFromMaxYMaxX(PAreaF<S> area,
                                                        float x_diff,
                                                        float y_diff)

      Scale `area` by adding `x_diff` to the width, and `y_diff` to the height. The size of the resulting area is clamped so that its width and height are always non-negative.

      The area is resized by moving its maximum-y-maximum-x corner.

      Type Parameters:
        `S` - The coordinate space of the area
      Parameters:
        `area` - The area
        `x_diff` - The X difference
        `y_diff` - The Y difference
      Returns:
        A resized area

    - #### scaleFromCenter

          public static <S> PAreaF<S> scaleFromCenter(PAreaF<S> area,
                                                      float x_diff,
                                                      float y_diff)

      Scale `area` by adding `x_diff` to the width, and `y_diff` to the height. The size of the resulting area is clamped so that its width and height are always non-negative.

      The area is resized from its own center.

      Type Parameters:
        `S` - The coordinate space of the area
      Parameters:
        `area` - The area
        `x_diff` - The X difference
        `y_diff` - The Y difference
      Returns:
        A resized area

    - #### overlaps

          public static <S> boolean overlaps(PAreaF<S> a,
                                             PAreaF<S> b)

      Determine whether or not two areas overlap.

      Overlapping is reflexive: `overlaps(a, a) == true`.

      Overlapping is symmetric: `overlaps(a, b) == contains(b, a)`.

      Overlapping is not necessarily transitive.

      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `a` - An area
        `b` - An area
      Returns:
        `true` iff `a` overlaps `b`

    - #### couldFitInside

          public static <S> boolean couldFitInside(PAreaF<S> a,
                                                   PAreaF<S> b)

      Determine whether or not one area could fit inside another.

      Fitting is reflexive: `couldFitInside(a, a) == true`.

      Fitting is transitive: `couldFitInside(a, b) → couldFitInside(b, c) → couldFitInside(a, c)`.

      Fitting is not necessarily symmetric.

      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `a` - An area
        `b` - An area
      Returns:
        `true` iff `a` could fit inside `b`

    - #### containing

          public static <S> PAreaF<S> containing(PAreaF<S> a,
                                                 PAreaF<S> b)

      Construct a area that will contain both `a` and `b`.
      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `a` - An area
        `b` - An area
      Returns:
        An area containing `a` and `b`

    - #### containsPoint

          public static <S> boolean containsPoint(PAreaF<S> a,
                                                  float x,
                                                  float y)

      Determine whether or not a area contains a given point.

      Type Parameters:
        `S` - The coordinate space of the area
      Parameters:
        `a` - An area
        `x` - The X coordinate of the point
        `y` - The Y coordinate of the point
      Returns:
        `true` iff `a` contains `(x, y)`

    - #### fitBetweenHorizontal

          public static <S> PAreaF<S> fitBetweenHorizontal(PAreaF<S> fit,
                                                           PAreaF<S> a,
                                                           PAreaF<S> b)

      Attempt to fit `fit` between `a` and `b`, horizontally.
      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `fit` - The area to be fitted
        `a` - An area
        `b` - An area
      Returns:
        A fitted area

    - #### fitBetweenVertical

          public static <S> PAreaF<S> fitBetweenVertical(PAreaF<S> fit,
                                                         PAreaF<S> a,
                                                         PAreaF<S> b)

      Attempt to fit `fit` between `a` and `b`, vertically.
      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `fit` - The area to be fitted
        `a` - An area
        `b` - An area
      Returns:
        A fitted area

    - #### splitAlongParallelToX

          public static <S> PAreaXSplitF<S,PAreaF<S>> splitAlongParallelToX(PAreaF<S> area,
                                                                            float y)

      Split `area` along a line parallel to the X axis placed at `y` units from its own minimum-y edge.
      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `area` - The area to be split
        `y` - The relative Y coordinate of the splitting edge
      Returns:
        A pair of areas

    - #### splitAlongParallelToY

          public static <S> PAreaYSplitF<S,PAreaF<S>> splitAlongParallelToY(PAreaF<S> area,
                                                                            float x)

      Split `area` along a line parallel to the Y axis placed at `x` units from its own minimum-x edge.
      Type Parameters:
        `S` - The coordinate space of the areas
      Parameters:
        `area` - The area to be split
        `x` - The relative X coordinate of the splitting edge
      Returns:
        A pair of areas

    - #### show

          public static <S> String show(PAreaF<S> area)

      Type Parameters:
        `S` - The coordinate space of the area
      Parameters:
        `area` - The area
      Returns:
        A terse string describing the position and size of the area

    - #### size

          public static <S> PAreaSizeF<S> size(PAreaF<S> area)

      Type Parameters:
        `S` - The coordinate space of the area
      Parameters:
        `area` - The area
      Returns:
        The size of the area

    - #### showToBuilder

          public static <S> String showToBuilder(PAreaF<S> area,
                                                 StringBuilder sb)

      Type Parameters:
        `S` - The coordinate space of the area
      Parameters:
        `area` - The area
        `sb` - A string builder
      Returns:
        A terse string describing the position and size of the area

Copyright © 2017 <code@io7m.com> http://io7m.com