clamp method

Coordinate clamp(
  1. Coordinate maxCoor,
  2. Coordinate minCoor
)

@param maxCoor -- Beginning of range @param minCoor -- End of range

Implementation

Coordinate clamp(Coordinate maxCoor, Coordinate minCoor)
{
  return max(maxCoor).min(minCoor);
}