com.io7m.jregions.core.unparameterized.areas

## Class AreasBD

- java.lang.Object
- - com.io7m.jregions.core.unparameterized.areas.AreasBD

-     public final class AreasBD
      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 AreaBD` | `alignCenter(AreaBD outer, AreaBD inner)` Align the area `inner` such that the center of the area is equal to the center of `outer`.
    `static AreaBD` | `alignHorizontallyCenter(AreaBD outer, AreaBD inner)` Align the area `inner` horizontally in the center of `outer`.
    `static AreaBD` | `alignHorizontallyMaxX(AreaBD outer, AreaBD inner)` Equivalent to calling `alignHorizontallyMaxXOffset(AreaBD, AreaBD, java.math.BigDecimal)` with a zero offset.
    `static AreaBD` | `alignHorizontallyMaxXOffset(AreaBD outer, AreaBD inner, BigDecimal offset)` Align the area `inner` horizontally against the inside maximum-x edge of `outer`.
    `static AreaBD` | `alignHorizontallyMinX(AreaBD outer, AreaBD inner)` Equivalent to calling `alignHorizontallyMinXOffset(AreaBD, AreaBD, java.math.BigDecimal)` with a zero offset.
    `static AreaBD` | `alignHorizontallyMinXOffset(AreaBD outer, AreaBD inner, BigDecimal offset)` Align the area `inner` horizontally against the inside minimum-x edge of `outer`.
    `static AreaBD` | `alignMaxYMaxX(AreaBD outer, AreaBD inner)` Equivalent to calling `alignMaxYMaxXOffset(AreaBD, AreaBD, java.math.BigDecimal, java.math.BigDecimal)` with zero offsets.
    `static AreaBD` | `alignMaxYMaxXOffset(AreaBD outer, AreaBD inner, BigDecimal offset_x, BigDecimal 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 AreaBD` | `alignMaxYMinX(AreaBD outer, AreaBD inner)` Equivalent to calling `alignMaxYMinXOffset(AreaBD, AreaBD, java.math.BigDecimal, java.math.BigDecimal)` with zero offsets.
    `static AreaBD` | `alignMaxYMinXOffset(AreaBD outer, AreaBD inner, BigDecimal offset_x, BigDecimal 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 AreaBD` | `alignMinYMaxX(AreaBD outer, AreaBD inner)` Equivalent to calling `alignMinYMaxXOffset(AreaBD, AreaBD, java.math.BigDecimal, java.math.BigDecimal)` with zero offsets.
    `static AreaBD` | `alignMinYMaxXOffset(AreaBD outer, AreaBD inner, BigDecimal offset_x, BigDecimal 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 AreaBD` | `alignMinYMinX(AreaBD outer, AreaBD inner)` Equivalent to calling `alignMinYMinXOffset(AreaBD, AreaBD, java.math.BigDecimal, java.math.BigDecimal)` with zero offsets.
    `static AreaBD` | `alignMinYMinXOffset(AreaBD outer, AreaBD inner, BigDecimal offset_x, BigDecimal 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 AreaBD` | `alignVerticallyCenter(AreaBD outer, AreaBD inner)` Align the area `inner` vertically in the center of `outer`.
    `static AreaBD` | `alignVerticallyMaxY(AreaBD outer, AreaBD inner)` Equivalent to calling `alignVerticallyMaxYOffset(AreaBD, AreaBD, java.math.BigDecimal)` with a zero offset.
    `static AreaBD` | `alignVerticallyMaxYOffset(AreaBD outer, AreaBD inner, BigDecimal offset)` Align the area `inner` vertically against the inside maximum-y edge of `outer`.
    `static AreaBD` | `alignVerticallyMinY(AreaBD outer, AreaBD inner)` Equivalent to calling `alignVerticallyMinYOffset(AreaBD, AreaBD, java.math.BigDecimal)` with a zero offset.
    `static AreaBD` | `alignVerticallyMinYOffset(AreaBD outer, AreaBD inner, BigDecimal offset)` Align the area `inner` vertically against the inside minimum-y edge of `outer`.
    `static AreaBD` | `containing(AreaBD a, AreaBD b)` Construct a area that will contain both `a` and `b`.
    `static boolean` | `contains(AreaBD a, AreaBD b)` Determine whether or not one area contains another.
    `static boolean` | `containsPoint(AreaBD a, BigDecimal x, BigDecimal y)` Determine whether or not a area contains a given point.
    `static boolean` | `couldFitInside(AreaBD a, AreaBD b)` Determine whether or not one area could fit inside another.
    `static AreaBD` | `create(BigDecimal x, BigDecimal y, BigDecimal width, BigDecimal height)` Create an area of width `width` and height `height`, placing the minimum corner at `(x, y)`.
    `static AreaBD` | `fitBetweenHorizontal(AreaBD fit, AreaBD a, AreaBD b)` Attempt to fit `fit` between `a` and `b`, horizontally.
    `static AreaBD` | `fitBetweenVertical(AreaBD fit, AreaBD a, AreaBD b)` Attempt to fit `fit` between `a` and `b`, vertically.
    `static AreaBD` | `hollowOut(AreaBD outer, BigDecimal min_x_offset, BigDecimal max_x_offset, BigDecimal min_y_offset, BigDecimal max_y_offset)` Construct a new area that fits inside `outer` based on the given offsets from each edge.
    `static AreaBD` | `hollowOutEvenly(AreaBD outer, BigDecimal offset)` Equivalent to calling `hollowOut(AreaBD, java.math.BigDecimal, java.math.BigDecimal, java.math.BigDecimal, java.math.BigDecimal)` with `offset` for all offset parameters.
    `static AreaBD` | `moveAbsolute(AreaBD area, BigDecimal x, BigDecimal y)` Move the given area to `(x, y)`.
    `static AreaBD` | `moveRelative(AreaBD area, BigDecimal x, BigDecimal y)` Move the given area by `(x, y)`.
    `static AreaBD` | `moveToOrigin(AreaBD area)` Move the given area to `(0, 0)`.
    `static boolean` | `overlaps(AreaBD a, AreaBD b)` Determine whether or not two areas overlap.
    `static AreaBD` | `scaleFromCenter(AreaBD area, BigDecimal x_diff, BigDecimal y_diff)` Scale `area` by adding `x_diff` to the width, and `y_diff` to the height.
    `static AreaBD` | `scaleFromMaxYMaxX(AreaBD area, BigDecimal x_diff, BigDecimal y_diff)` Scale `area` by adding `x_diff` to the width, and `y_diff` to the height.
    `static AreaBD` | `scaleFromMaxYMinX(AreaBD area, BigDecimal x_diff, BigDecimal y_diff)` Scale `area` by adding `x_diff` to the width, and `y_diff` to the height.
    `static AreaBD` | `scaleFromMinYMaxX(AreaBD area, BigDecimal x_diff, BigDecimal y_diff)` Scale `area` by adding `x_diff` to the width, and `y_diff` to the height.
    `static AreaBD` | `scaleFromMinYMinX(AreaBD area, BigDecimal x_diff, BigDecimal y_diff)` Scale `area` by adding `x_diff` to the width, and `y_diff` to the height.
    `static AreaBD` | `setSizeFromCenter(AreaBD area, BigDecimal width, BigDecimal height)` Set the width and height of `area` to `width` and `height`, respectively.
    `static AreaBD` | `setSizeFromMaxYMaxX(AreaBD area, BigDecimal width, BigDecimal height)` Set the width and height of `area` to `width` and `height`, respectively.
    `static AreaBD` | `setSizeFromMaxYMinX(AreaBD area, BigDecimal width, BigDecimal height)` Set the width and height of `area` to `width` and `height`, respectively.
    `static AreaBD` | `setSizeFromMinYMaxX(AreaBD area, BigDecimal width, BigDecimal height)` Set the width and height of `area` to `width` and `height`, respectively.
    `static AreaBD` | `setSizeFromMinYMinX(AreaBD area, BigDecimal width, BigDecimal height)` Set the width and height of `area` to `width` and `height`, respectively.
    `static String` | `show(AreaBD area)`
    `static String` | `showToBuilder(AreaBD area, StringBuilder sb)`
    `static AreaXSplitBD<AreaBD>` | `splitAlongParallelToX(AreaBD area, BigDecimal y)` Split `area` along a line parallel to the X axis placed at `y` units from its own minimum-y edge.
    `static AreaYSplitBD<AreaBD>` | `splitAlongParallelToY(AreaBD area, BigDecimal 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 AreaBD create(BigDecimal x,
                                      BigDecimal y,
                                      BigDecimal width,
                                      BigDecimal height)

      Create an area of width `width` and height `height`, placing the minimum corner at `(x, y)`.
      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 boolean contains(AreaBD a,
                                         AreaBD 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.

      Parameters:
        `a` - Area A
        `b` - Area B
      Returns:
        `true` iff `a` contains `b`

    - #### moveRelative

          public static AreaBD moveRelative(AreaBD area,
                                            BigDecimal x,
                                            BigDecimal y)

      Move the given area by `(x, y)`.
      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 AreaBD moveAbsolute(AreaBD area,
                                            BigDecimal x,
                                            BigDecimal y)

      Move the given area to `(x, y)`.
      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 AreaBD moveToOrigin(AreaBD area)

      Move the given area to `(0, 0)`.
      Parameters:
        `area` - The area
      Returns:
        A moved area

    - #### alignHorizontallyCenter

          public static AreaBD alignHorizontallyCenter(AreaBD outer,
                                                       AreaBD inner)

      Align the area `inner` horizontally in the center of `outer`.
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
      Returns:
        An aligned area

    - #### alignHorizontallyMinX

          public static AreaBD alignHorizontallyMinX(AreaBD outer,
                                                     AreaBD inner)

      Equivalent to calling `alignHorizontallyMinXOffset(AreaBD, AreaBD, java.math.BigDecimal)` with a zero offset.
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
      Returns:
        An aligned area

    - #### alignHorizontallyMinXOffset

          public static AreaBD alignHorizontallyMinXOffset(AreaBD outer,
                                                           AreaBD inner,
                                                           BigDecimal 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.
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
        `offset` - The offset from the edge s
      Returns:
        An aligned area

    - #### alignHorizontallyMaxX

          public static AreaBD alignHorizontallyMaxX(AreaBD outer,
                                                     AreaBD inner)

      Equivalent to calling `alignHorizontallyMaxXOffset(AreaBD, AreaBD, java.math.BigDecimal)` with a zero offset.
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
      Returns:
        An aligned area

    - #### alignHorizontallyMaxXOffset

          public static AreaBD alignHorizontallyMaxXOffset(AreaBD outer,
                                                           AreaBD inner,
                                                           BigDecimal 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.
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
        `offset` - The offset from the edge s
      Returns:
        An aligned area

    - #### alignVerticallyMinY

          public static AreaBD alignVerticallyMinY(AreaBD outer,
                                                   AreaBD inner)

      Equivalent to calling `alignVerticallyMinYOffset(AreaBD, AreaBD, java.math.BigDecimal)` with a zero offset.
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
      Returns:
        An aligned area

    - #### alignVerticallyMinYOffset

          public static AreaBD alignVerticallyMinYOffset(AreaBD outer,
                                                         AreaBD inner,
                                                         BigDecimal 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.
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
        `offset` - The offset from the edge s
      Returns:
        An aligned area

    - #### alignVerticallyMaxY

          public static AreaBD alignVerticallyMaxY(AreaBD outer,
                                                   AreaBD inner)

      Equivalent to calling `alignVerticallyMaxYOffset(AreaBD, AreaBD, java.math.BigDecimal)` with a zero offset.
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
      Returns:
        An aligned area

    - #### alignVerticallyMaxYOffset

          public static AreaBD alignVerticallyMaxYOffset(AreaBD outer,
                                                         AreaBD inner,
                                                         BigDecimal 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.
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
        `offset` - The offset from the edge s
      Returns:
        An aligned area

    - #### alignVerticallyCenter

          public static AreaBD alignVerticallyCenter(AreaBD outer,
                                                     AreaBD inner)

      Align the area `inner` vertically in the center of `outer`.
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
      Returns:
        An aligned area

    - #### alignMinYMinX

          public static AreaBD alignMinYMinX(AreaBD outer,
                                             AreaBD inner)

      Equivalent to calling `alignMinYMinXOffset(AreaBD, AreaBD, java.math.BigDecimal, java.math.BigDecimal)` with zero offsets.
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
      Returns:
        An aligned area

    - #### alignMinYMinXOffset

          public static AreaBD alignMinYMinXOffset(AreaBD outer,
                                                   AreaBD inner,
                                                   BigDecimal offset_x,
                                                   BigDecimal 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`.
      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 AreaBD alignMinYMaxX(AreaBD outer,
                                             AreaBD inner)

      Equivalent to calling `alignMinYMaxXOffset(AreaBD, AreaBD, java.math.BigDecimal, java.math.BigDecimal)` with zero offsets.
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
      Returns:
        An aligned area

    - #### alignMinYMaxXOffset

          public static AreaBD alignMinYMaxXOffset(AreaBD outer,
                                                   AreaBD inner,
                                                   BigDecimal offset_x,
                                                   BigDecimal 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`.
      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 AreaBD alignMaxYMinX(AreaBD outer,
                                             AreaBD inner)

      Equivalent to calling `alignMaxYMinXOffset(AreaBD, AreaBD, java.math.BigDecimal, java.math.BigDecimal)` with zero offsets.
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
      Returns:
        An aligned area

    - #### alignMaxYMinXOffset

          public static AreaBD alignMaxYMinXOffset(AreaBD outer,
                                                   AreaBD inner,
                                                   BigDecimal offset_x,
                                                   BigDecimal 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`.
      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 AreaBD alignMaxYMaxX(AreaBD outer,
                                             AreaBD inner)

      Equivalent to calling `alignMaxYMaxXOffset(AreaBD, AreaBD, java.math.BigDecimal, java.math.BigDecimal)` with zero offsets.
      Parameters:
        `outer` - The outer area
        `inner` - The inner area
      Returns:
        An aligned area

    - #### alignMaxYMaxXOffset

          public static AreaBD alignMaxYMaxXOffset(AreaBD outer,
                                                   AreaBD inner,
                                                   BigDecimal offset_x,
                                                   BigDecimal 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`.
      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 AreaBD alignCenter(AreaBD outer,
                                           AreaBD inner)

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

    - #### hollowOut

          public static AreaBD hollowOut(AreaBD outer,
                                         BigDecimal min_x_offset,
                                         BigDecimal max_x_offset,
                                         BigDecimal min_y_offset,
                                         BigDecimal max_y_offset)

      Construct a new area that fits inside `outer` based on the given offsets from each edge.
      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 AreaBD hollowOutEvenly(AreaBD outer,
                                               BigDecimal offset)

      Equivalent to calling `hollowOut(AreaBD, java.math.BigDecimal, java.math.BigDecimal, java.math.BigDecimal, java.math.BigDecimal)` with `offset` for all offset parameters.
      Parameters:
        `outer` - The containing area
        `offset` - The offset from each edge (must be non-negative)
      Returns:
        A new area

    - #### setSizeFromCenter

          public static AreaBD setSizeFromCenter(AreaBD area,
                                                 BigDecimal width,
                                                 BigDecimal height)

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

      The area is resized from its own center.

      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 AreaBD setSizeFromMinYMinX(AreaBD area,
                                                   BigDecimal width,
                                                   BigDecimal 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.

      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 AreaBD setSizeFromMinYMaxX(AreaBD area,
                                                   BigDecimal width,
                                                   BigDecimal 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.

      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 AreaBD setSizeFromMaxYMaxX(AreaBD area,
                                                   BigDecimal width,
                                                   BigDecimal 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.

      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 AreaBD setSizeFromMaxYMinX(AreaBD area,
                                                   BigDecimal width,
                                                   BigDecimal 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.

      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 AreaBD scaleFromMinYMinX(AreaBD area,
                                                 BigDecimal x_diff,
                                                 BigDecimal 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.

      Parameters:
        `area` - The area
        `x_diff` - The X difference
        `y_diff` - The Y difference
      Returns:
        A resized area

    - #### scaleFromMinYMaxX

          public static AreaBD scaleFromMinYMaxX(AreaBD area,
                                                 BigDecimal x_diff,
                                                 BigDecimal 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.

      Parameters:
        `area` - The area
        `x_diff` - The X difference
        `y_diff` - The Y difference
      Returns:
        A resized area

    - #### scaleFromMaxYMinX

          public static AreaBD scaleFromMaxYMinX(AreaBD area,
                                                 BigDecimal x_diff,
                                                 BigDecimal 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.

      Parameters:
        `area` - The area
        `x_diff` - The X difference
        `y_diff` - The Y difference
      Returns:
        A resized area

    - #### scaleFromMaxYMaxX

          public static AreaBD scaleFromMaxYMaxX(AreaBD area,
                                                 BigDecimal x_diff,
                                                 BigDecimal 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.

      Parameters:
        `area` - The area
        `x_diff` - The X difference
        `y_diff` - The Y difference
      Returns:
        A resized area

    - #### scaleFromCenter

          public static AreaBD scaleFromCenter(AreaBD area,
                                               BigDecimal x_diff,
                                               BigDecimal 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.

      Parameters:
        `area` - The area
        `x_diff` - The X difference
        `y_diff` - The Y difference
      Returns:
        A resized area

    - #### overlaps

          public static boolean overlaps(AreaBD a,
                                         AreaBD 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.

      Parameters:
        `a` - An area
        `b` - An area
      Returns:
        `true` iff `a` overlaps `b`

    - #### couldFitInside

          public static boolean couldFitInside(AreaBD a,
                                               AreaBD 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.

      Parameters:
        `a` - An area
        `b` - An area
      Returns:
        `true` iff `a` could fit inside `b`

    - #### containing

          public static AreaBD containing(AreaBD a,
                                          AreaBD b)

      Construct a area that will contain both `a` and `b`.
      Parameters:
        `a` - An area
        `b` - An area
      Returns:
        An area containing `a` and `b`

    - #### containsPoint

          public static boolean containsPoint(AreaBD a,
                                              BigDecimal x,
                                              BigDecimal y)

      Determine whether or not a area contains a given point.

      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 AreaBD fitBetweenHorizontal(AreaBD fit,
                                                    AreaBD a,
                                                    AreaBD b)

      Attempt to fit `fit` between `a` and `b`, horizontally.
      Parameters:
        `fit` - The area to be fitted
        `a` - An area
        `b` - An area
      Returns:
        A fitted area

    - #### fitBetweenVertical

          public static AreaBD fitBetweenVertical(AreaBD fit,
                                                  AreaBD a,
                                                  AreaBD b)

      Attempt to fit `fit` between `a` and `b`, vertically.
      Parameters:
        `fit` - The area to be fitted
        `a` - An area
        `b` - An area
      Returns:
        A fitted area

    - #### splitAlongParallelToX

          public static AreaXSplitBD<AreaBD> splitAlongParallelToX(AreaBD area,
                                                                   BigDecimal y)

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

    - #### splitAlongParallelToY

          public static AreaYSplitBD<AreaBD> splitAlongParallelToY(AreaBD area,
                                                                   BigDecimal x)

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

    - #### show

          public static String show(AreaBD area)

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

    - #### showToBuilder

          public static String showToBuilder(AreaBD area,
                                             StringBuilder sb)

      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