And here is test3.cpp:
#include <stdafx.h>
#include <math.h>
#include "test3.h"
CMyApp myApp;
BOOL CMyApp::InitInstance()
{
m_pMainWnd = new CMainWindow();
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return TRUE;
}
BEGIN_MESSAGE_MAP (CMainWindow, CFrameWnd)
ON_WM_PAINT()
END_MESSAGE_MAP()
CMainWindow::CMainWindow()
{
Create(NULL, "TEST");
}
double CMainWindow::XPolarFn(double angle)
{
double value;
value = sin(angle);
value *= scalar;
return(value);
}
double CMainWindow::YPolarFn(double angle)
{
double value;
value = sin(angle) * sin(.9 * angle);
value *= scalar;
return(value);
}
void CMainWindow:

nPaint()
{
CClientDC dc (this);
CRect rect;
double angle, angle_increment, centerX, centerY;
angle_increment = 0.01;
GetClientRect(&rect);
centerX = rect.Width() / 2;
centerY = rect.Height() / 2;
for(angle = 0; angle <= 360; angle += angle_increment)
dc.SetPixel((int)(XPolarFn(angle) * cos(angle) + centerX), (int)(YPolarFn(angle) * sin(angle) + centerY), 0);
}