http://i206.photobucket.com/albums/bb172/cghicks16/untitled.jpg
[IMG]
http://i206.photobucket.com/albums/bb172/cghicks16/untitled.jpg[/IMG]
This is what I am trying to get my output to look like. and once again I get a line but this time its a horizontal line instead of a vertical. my editied code looks like now:
void DrawStuff() {
COLORREF color = RGB(205, 0, 13); // purple color to draw with
char str[32]; // string to store user input
int h,k,yPosInt,xPosInt;
double constA;
double PI = 3.142;
// get the user input from the edit boxes and
// convert string input to integer
GetDlgItemText(HDialog, IDC_EDIT_h, str, 32);
h = atoi(str);
GetDlgItemText(HDialog, IDC_EDIT_k, str, 32);
k = atoi(str);
GetDlgItemText(HDialog, IDC_EDIT_constA, str, 32);
constA = atof(str);
// clear the scene and add an axis
PGraphics->ClearScene(RGB(0, 0, 0));
PGraphics->AddAxis(RGB(150, 150, 150), 10);
// draw some pixels around the points entered by the user
for(double xPos = -360; xPos <=360; xPos+=.25)
{
yPosInt = (int) (constA * cos(2 * PI * xPos / h + k)); //h & k are B and P
xPosInt = (int) xPos;
PGraphics->AddPoint(xPos,yPosInt,color);
}
// draw the points
PGraphics->Draw();