As said, you need to create while loop where you are rotating xline for example until you get wanted area within defined tolerance. And yes like you said, the tricky part is angle step size, but you can define conditions for optimal running. In each loop you will check if result has been reached, if its not you will know the difference between current and needed area, and depending on that you can increase the rotation angle. In simpler words, as difference in area is decreasing you decrease rotation angle, so you don't have too many iterations.
I have done something like that for my company. I attached image with point where area is 300 m2 if it still interests you.