View Full Version : Help!!!....How to draw curves using dot plots
How can I draw this mathematical function
f(x) = e^-x(cos(2(3.14285714)x))
int num = ???;
float start = ???;
float end = ???;
float dx = (end - start) / num;
for(int i = 0; i <= num; i++)
float x = start + i*dx;
float fx = exp(-x * cos(2*3.14285714*x));
End();it's sloppy, but should work if you setup your modelview and projection properly.
06-09-2004, 11:57 PM
And I found it nicer to use GL_LINES instead of GL_POINTS.
here here, lines are much nicer, less pointy.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.