Get an axis value. For OO patterns.
double getAxis(Axis axis) { switch (axis) { case Axis.X: return x; case Axis.Y: return y; default: throw IllegalArgumentException(); } }