def _rotate_point(point, angle, ishape, rshape, reverse=False):
<EOL>if reverse:<EOL><INDENT>angle = (angle * -<NUM_LIT:1>)<EOL>temp = ishape<EOL>ishape = rshape<EOL>rshape = temp<EOL><DEDENT>yhalf, xhalf = ishape<EOL>yrhalf, xrhalf = rshape<EOL>yhalf = yhalf / <NUM_LIT:2><EOL>xhalf = xhalf / <NUM_LIT:2><EOL>yrhalf = yrhalf / <NUM_LIT:2><EOL>xrhalf = xrhalf / <NUM_LIT:2><EOL>startx = point[<NUM_LIT:0>] - xhalf<EOL>starty = point[<NUM_LIT:1>] - yhalf<EOL>newx = startx * np.cos(angle) - starty * np.sin(angle)<EOL>newy = startx * np.sin(angle) + starty * np.cos(angle)<EOL>newx = newx + xrhalf<EOL>newy = newy + yrhalf<EOL>return (newx, newy)<EOL>
Transform a point from original image coordinates to rotated image
    coordinates and back. It assumes the rotation point is the center of an
    image.

    This works on a simple rotation transformation::

        newx = (startx) * np.cos(angle) - (starty) * np.sin(angle)
        newy = (startx) * np.sin(angle) + (starty) * np.cos(angle)

    It takes into account the differences in image size.

    Parameters
    ----------
    point : tuple
        Point to be rotated, in the format of ``(x, y)`` measured from
        origin.

    angle : float
        The angle in degrees to rotate the point by as measured
        counter-clockwise from the X axis.

    ishape : tuple
        The shape of the original image, taken from ``image.shape``.

    rshape : tuple
        The shape of the rotated image, in the form of ``rotate.shape``.

    reverse : bool, optional
        Transform from rotated coordinates back to non-rotated image.

    Returns
    -------
    rotated_point : tuple
        Rotated point in the format of ``(x, y)`` as measured from origin.