Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

18
LINES

< > BotCompany Repo | #1014002 // mandelbrotZoomCoordinates

JavaX fragment (include)

1  
static double mandelbrotZoomCoordinates_ratio = 16.0/9;
2  
static double mandelbrotZoomCoordinates_zoomStep = 1-1e-2;
3  
4  
static L<DoubleRect> mandelbrotZoomCoordinates(int steps, double lookAtX, double lookAtY) {
5  
  int nSteps = 0;
6  
  new L<DoubleRect> l;
7  
  for (double w = 1.0; nSteps < steps; w *= mandelbrotZoomCoordinates_zoomStep) {
8  
    ++nSteps;
9  
    double h = w/mandelbrotZoomCoordinates_ratio;
10  
    double x1 = lookAtX-w;
11  
    double x2 = lookAtX+w;
12  
    double y1 = lookAtY-h;
13  
    double y2 = lookAtY+h;
14  
    //print(nSteps + ": "+ x1 + ", " + y1 + ", " + x2 + ", " + y2);
15  
    l.add(DoubleRect(x1, y1, x2-x1, y2-y1));
16  
  }
17  
  ret l;
18  
}

Author comment

Began life as a copy of #1014001

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1014002
Snippet name: mandelbrotZoomCoordinates
Eternal ID of this version: #1014002/4
Text MD5: a15f964c376345513784686d918d9ad5
Author: stefan
Category: javax / web
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-03-19 05:12:02
Source code size: 647 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 374 / 410
Version history: 3 change(s)
Referenced in: [show references]