Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DimX=800
- DimY=800
- Zoom=0.7
- Angle=1.11
- function setup() {
- createCanvas(DimX, DimY);
- }
- function draw() {
- background(220);
- a=Angle
- y=0
- sn=sin(a)
- cs=cos(a)
- xi=-1.2
- xf=1.2
- yi=-1.2
- yf=1.2
- sx=(xf-xi)/(DimX*Zoom)
- sy=(yf-yi)/(DimY*Zoom)
- cl=0
- for(xc=xi; xc<xf; xc=xc+sx){
- y=xc
- x=xc
- i=1
- while(i <= 1000) {
- if (x > 1.0E+15)
- break;
- yx = y-x*x
- xx=x*cs-yx*sn
- y=x*sn+yx*cs
- x=xx
- px=int((DimX/2)+x/sx)
- py=int((DimY/2)-y/sy)
- if (px>0 && px<=DimX && py>0 && py<=DimY){
- stroke(cl%256, cl%128, cl%64)
- point(px, py)
- }
- i=i+1
- }
- cl=cl+1
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement