I have an image that the user is able to draw a 3px line across, and that line is extended to the edges of the image. What I'd like to do is crop the image to the pixels under the line and rotate them to have a 3px width portrait-oriented image.

I can get the exact coordinates of the user-drawn line. I've been playing around with -rotate, as it's easy math to calculate the angle of the line. But it comes time to crop the rotated image, I can't figure out how to find the line's position once again. Cropping first doesn't solve the problem.
Any thoughts from a brilliant person?
Thanks in advance!