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-10-2004, 12:57 AM
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.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.