$40 off Craftsman 5 Drawer Homeowner Tool Center with Riser and Parts Bins $99.99 on sale 10/2-10/8
Sears Deal of the Day: Thule Car Top Carrier, Quest

Figure 30
===========================
/*
//Author: Cheikh Drame
//To support, please do one of the following
//- Visit irap123.com many times a day
//- Join irap123.com
//- Buy my app irap123 (rhyming dictionary) available for android, and iphone. On windows phone, it is called iLyrics. If not, you can get the desktop version at www.irap123.com/apps/webstore/
//- Include irap123.com in your blogs, forums, facebook walls, email footers, comments
//- send a donation at my paypal address at cbdsigned.vevo@gmail.com
//- Buy a story at http://shop.pparzygnat.com
*/
// JuliaSet.cpp : Defines the entry point for the console application.
//
#include
#include
int height=400, width=400;
int julia(double x, double y, int n)
{
double xx, yy, p=-0.7454, q=0.1131;
int i=0;
xx=x*x;
yy=y*y;
while(++i
x=xx-yy+p;
xx=x*x;
yy=y*y;
if( (xx+yy)>4) return i;
}
return 0;
}
void display(void)
{
double min_a, min_b,max_a, max_b, step_a, step_b, a,b;
int c, n=180;
float scale=255.0/n;
min_a=-1.6;
max_a=1.6;
min_b=-1.2;
max_b=1.2;
step_a=(max_a-min_a)/width;
step_b=(max_b-min_b)/height;
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_POINTS);
a=min_a;
for(int x=0; x
for(int y=0; y
glColor3ub(c,c,c);
glVertex2i(x,y);
b+=step_b;
}
a+=step_a;
}
glEnd();
glFlush();
}
void main(int argc, char**argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
glutInitWindowSize(400,400);
glutInitWindowPosition(200,100);
glutCreateWindow("sample Prog: Points by irap123.com");
glClearColor(0.0,0.0,0.0,0.0);
gluOrtho2D(-2.0, 2.0,-1.5,1.5);
//gluOrtho2D(-10.0, 10.0, -10, 10);
glutDisplayFunc(display);
glutMainLoop();
}
No comments:
Post a Comment