delphi - How do I call the Pie function? -


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:

  1. upper left of rectangular border Corner.
  2. Bottom right corner of rectangular border.
  3. The beginning of the pie, pointing towards the wheel.
  4. 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.

  1. x1 = cx-r, y1 = cx + r
  2. x2 = cx + r, y2 = c-r
  3. X3 = cx, y3 = or 1
  4. 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):

  1. x3 = cx + r sin (a), y3 = c + R Cause (A)
  2. X4 = CX + RC (B), Y4 = C + R Cos (B)

Comments