椭圆公式没忘吧?
r = (a * b) / sqrt(cos(A)*cos(A)*b*b + sin(A)*sin(A)*a*a);
其中
a,b是椭圆长短轴,(这个是已知吧?)
角度A是就是你说的射线的角度,(那么cos(A)和sin(A)也已知了)
r就是你说的中心点到弧端点的长度,
那么端点坐标就好求了吧。(注意坐标转换!)
//根据角度得到弧的端点坐标
POINT GetArcPoint(LPCRECT lpRect, double angle)
{
long a = abs((lpRect->right-lpRect->left)/2);
long b = abs((lpRect->bottom-lpRect->top)/2);
double radio;
POINT pt;
radio = (a*b)*1.0 / sqrt( (sin(angle)*sin(angle))*(a*a) + (cos(angle)*cos(angle))*(b*b) ) ;
long dx,dy;
dx = (long)(radio*cos(angle));
dy = (long)(radio*sin(angle));
BOOL Arc(
HDC hdc, // handle to device context
int nLeftRect, // x-coord of rectangle's upper-left corner
int nTopRect, // y-coord of rectangle's upper-left corner
int nRightRect, // x-coord of rectangle's lower-right corner
int nBottomRect, // y-coord of rectangle's lower-right corner
int nXStartArc, // x-coord of first radial ending point
int nYStartArc, // y-coord of first radial ending point
int nXEndArc, // x-coord of second radial ending point
int nYEndArc // y-coord of second radial ending point
);