#define Pi 3.1415926
#define r 100
#include <math.h>
void CMyView::OnDraw(CDC* pDC)
{
CMyDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
Point point[10];
double fAngle = 0;
CRect rect;
GetClientRect(&rect);
pDC->SetViewportOrg(rect.Width()/2,rect.Height()/2);
pDC->MoveTo(CPoint(r,0));
for ( int i=0; i<10; i++, fAngle+= 2*Pi/10)
{
point[i].x = r * cos (fAngle);
point[i].y= r * sin (fAngle);
pDC->LineTo(CPoint(point[i].x,point[i].y));
POINT * pPoint = new POINT[N];
POINT * pTemp = pPoint;
float fAngle = 0;
for ( int i=0; i<N; i++, fAngle+= 2*Pi/N, pTemp++ ) {
*pTemp.x = r * cos (fAngle)
*pTemp.y = r * sin (fAngle)
};
pDC->Polyline(pPoint, N);
delete[] pPoint;