Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions C_CPP/render.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@
#define N DIM
#define N1 (DIM - 1)

unsigned char RD(int x, int y, float t) {
// TODO: YOUR CODE HERE
return 0;
}
unsigned char GR(int x, int y, float t) {
// TODO: YOUR CODE HERE
return 0;
}
unsigned char BL(int x, int y, float t) {
// TODO: YOUR CODE HERE
return 0;
}
unsigned char RD(int x, int y, float t) {v2 c=v2(-0.8,cos(t)*0.2);v2 z = v2(2.0*x/f(N-1)-1.0,2.0*(f(y)/N-0.5));int i=0;while(no2(z)<20&&i<50){v2 s=v2(z.x*z.x-z.y*z.y,z.x*z.y*2.0);z=a2(c,s);i++;}return 255-i*5.1;}
unsigned char GR(int x, int y, float t) {v2 c=v2(-0.8,cos(t)*0.2);v2 z = v2(2.0*x/f(N-1)-1.0,2.0*(f(y)/N-0.5));int i=0;while(no2(z)<20&&i<50){v2 s=v2(z.x*z.x-z.y*z.y,z.x*z.y*2.0);z=a2(c,s);i++;}return 255-i*5.1;}
unsigned char BL(int x, int y, float t) {v2 c=v2(-0.8,cos(t)*0.2);v2 z = v2(2.0*x/f(N-1)-1.0,2.0*(f(y)/N-0.5));int i=0;while(no2(z)<20&&i<50){v2 s=v2(z.x*z.x-z.y*z.y,z.x*z.y*2.0);z=a2(c,s);i++;}return 255-i*5.1;}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
![JuliaSet](./assets/example.gif)

举个例子,上面的JuliaSet图像我们可以用下面的代码生成:

```c++
unsigned char RD(int x, int y, float t) {v2 c=v2(-0.8,cos(t)*0.2);v2 z = v2(2.0*x/f(N-1)-1.0,2.0*(f(y)/N-0.5));int i=0;while(no2(z)<20&&i<50){v2 s=v2(z.x*z.x-z.y*z.y,z.x*z.y*2.0);z=a2(c,s);i++;}return 255-i*5.1;}
unsigned char GR(int x, int y, float t) {v2 c=v2(-0.8,cos(t)*0.2);v2 z = v2(2.0*x/f(N-1)-1.0,2.0*(f(y)/N-0.5));int i=0;while(no2(z)<20&&i<50){v2 s=v2(z.x*z.x-z.y*z.y,z.x*z.y*2.0);z=a2(c,s);i++;}return 255-i*5.1;}
Expand Down