We should enforce this restriction, with something like this at the top:

    if (degrees !== 0 && degress !== 90 && degress !== 180 && degress !== 270) {
        throw new Error('Currently only 0, 90, 180, and 270 degrees are supported.');
    }

Also you could short circuit the 0 degrees case and immediately return a copy of the rectangle.