Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

graphing math functions

Status
Not open for further replies.

newapocalipsis

Programmer
Aug 10, 2001
48
0
0
MX
please help me i've searched over all the net and i haven´t found where in visual c++ i can graph a set of pixels of a math function what control should i use, pleasehelp me...

Golden Dragon Is Coming Soon...
 
use DierctX or OpenGl

Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
Or use simple GDI.

CSomeView::OnDraw(CDC* dc)
{
...
//for some value x set a pixel at (x, f(x))
// where f(int x) is a function you define
// Since (0,0) is at top left corner, y is computed from the bottom of the client rect.

CRect r;
GetClientRect(&r);

dc->SetPixel(x, r.bottom - f(x));
}

/Per
[sub]
if (typos) cout << &quot;My fingers are faster than my brain. Sorry for the typos.&quot;;
[/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top