a = theta + dtheta
        theta = theta + 2 * pi

        mapX = atX
        mapY = atY

        deltaX = 1 / cos(theta)
        deltaY = 1 / sin(theta)

        if deltaX > 0:
            stepX = 1
            distX = (mapX + 1 - x) * deltaX
        else:
            stepX = -1
            deltaX = -deltaX
            distX = (x - mapX) * (deltaX)

        if deltaY > 0:
            stepY = 1
            distY = (mapY + 1 - y) * deltaY
        else:
            stepY = -1
            deltaY = -deltaY
    