Rectangular rectangle

How can I calculate the bounding box of a piece. The values โ€‹โ€‹of radius (r), center point (x0, y0), StartAngle (a0), EndAngle (a1) and drawDirection (clockwise or counterclockwise) are known.

+4
source share
2 answers

Calculate the points at the end of the edge of the arc, the point at the center of the cut, and any of the four extreme points (angles 0, 90, 180, and 270) if they are contained within the sweep angle. Then all you have to do is iterate over all the points and find the minimum and maximum values โ€‹โ€‹of x and y.

+7
source

alt text

NTN!

+4
source

All Articles