开发者

Pie slice bounding rectangle

开发者 https://www.devze.com 2023-01-25 17:39 出处:网络
How can I calculate a pie slice bounding rectangle. Radius (r), center 开发者_开发问答point (x0, y0) , StartAngle (a0), EndAngle (a1) and drawDirection (clockwise or counterclockwise) variables are kn

How can I calculate a pie slice bounding rectangle. Radius (r), center 开发者_开发问答point (x0, y0) , StartAngle (a0), EndAngle (a1) and drawDirection (clockwise or counterclockwise) variables are known.


Compute the points at the end of the arc edge, the point at the center of the slice 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 x and y values.


Pie slice bounding rectangle

HTH!

0

精彩评论

暂无评论...
验证码 换一张
取 消