Page 1 of 1

Name the fractal created by the following code. Clearly explain how the algorithm works for creating the image shown, st

Posted: Sat May 14, 2022 3:29 pm
by answerhappygod
Name the fractal created by the following code. Clearly explain
how the algorithm works for creating the image shown, start your
discussion with the equation,
Name The Fractal Created By The Following Code Clearly Explain How The Algorithm Works For Creating The Image Shown St 1
Name The Fractal Created By The Following Code Clearly Explain How The Algorithm Works For Creating The Image Shown St 1 (177.14 KiB) Viewed 53 times
(d) Name the fractal created by the following code. [6 marks] Clearly explain how the algorithm works for creating the image shown, start your discussion with the equation, 2 Znew = Zola +C #include "stdafx.h" static void display(void) #include <freeglut.h> { #include <math.h> float s=0.01; void display(void); glClear(GL_COLOR_BUFFER_BIT); for(float x=-2;x<=0.8;X+=s) { int main(int argc, char *argv[]) for(float y=-1.2;y<=1.2;y+=s) { { float cx=x, cy=y, a=0,b=0, at=0,g=0; glutInitWindowSize(512,384); while((sqrt((a*a)+(b*b))<2.0)&&(8<=1.0)) { glutInitWindowPosition (100, 100); atra; glutInit(&argc, argv); a=(a*a)-(b*b)+cx; glutInitDisplayMode (GLUT_RGB b=(2.0*at*b)+cy; GLUT_SINGLE); g+=0.067; glutCreateWindow("Fractal"); } glMatrixMode (GL_PROJECTION); glColor3f(1-8,1-8,1-8); gluOrtho2D(-2.0.0.8, -1.2, 1.2); glRectf(x,y,X+s,y+5); giClearColor(0,0,0,1); } glutDisplayFunc(display); } glutMainLoop(); glFlush(); return 0; } } Fractal