how to draw a sector of a circle?
-
the three points ( center, start of arc ,end of arc) and the angle are known to me. I need to draw whenever these values are given. I saw CPie but for that you need to know the rect.
I would imagine that you have enough information to calculate the bounding rectangle.
Please do not read this signature.
-
the three points ( center, start of arc ,end of arc) and the angle are known to me. I need to draw whenever these values are given. I saw CPie but for that you need to know the rect.
As mentioned above, you got all the information needed. Now its time for mathematical calculation. Now i cannot understand, what's the hurdle in front of you to do that calculation :doh:
Величие не Бога может быть недооценена.
-
the three points ( center, start of arc ,end of arc) and the angle are known to me. I need to draw whenever these values are given. I saw CPie but for that you need to know the rect.
Please observe this formula to find the distance between two points[^] :) Now you could find the radius (R = d) of your circle: P1(x1, y1) - center point, P2(x2, y2) - start point Then you could determinate the rectangle (rc) :) : rc.left = x1 - R; rc.top = y1 - R; rc.right = x1 + R; rc.bottom = y1 + R;
virtual void BeHappy() = 0;
-
the three points ( center, start of arc ,end of arc) and the angle are known to me. I need to draw whenever these values are given. I saw CPie but for that you need to know the rect.
-
Please observe this formula to find the distance between two points[^] :) Now you could find the radius (R = d) of your circle: P1(x1, y1) - center point, P2(x2, y2) - start point Then you could determinate the rectangle (rc) :) : rc.left = x1 - R; rc.top = y1 - R; rc.right = x1 + R; rc.bottom = y1 + R;
virtual void BeHappy() = 0;