I have center point, radius and angle to attract pie, but takes 4 points as input data Does anyone have any conversion function or better explanation for this?
Four points in the pie function:
- upper left of rectangular border Corner.
- Bottom right corner of rectangular border.
- The beginning of the pie, pointing towards the wheel.
- Point to the circle marking the end of the pie (towards the clockwise).
conversion:
center point: cx, cy radius: a angle: a
Assume that your pie starts at the top.
- x1 = cx-r, y1 = cx + r
- x2 = cx + r, y2 = c-r
- X3 = cx, y3 = or 1
- x4 = cx + rc (a), y4 = c + r cos (a)
You may have to flip a signal somewhere, but it should do the trick.
with two different angels (A and B):
- x3 = cx + r sin (a), y3 = c + R Cause (A)
- X4 = CX + RC (B), Y4 = C + R Cos (B)
Comments
Post a Comment