getAxis method

double getAxis(
  1. Axis axis
)

Get axis. Enables general code to be written without knowing which axis ahead of time.

Implementation

double getAxis(Axis axis)
{
  switch (axis)
  {
    case Axis.X:
      return width;
    case Axis.Y:
      return height;
    default:
      throw new IllegalArgumentException("Bad axis argument.");
  }
}