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

9
LINES

< > BotCompany Repo | #1010377 // web_placeNodesOnU - arrange nodes in a U shape

JavaX fragment (include)

1  
static void web_placeNodesOnU(L<WebNode> nodes) {
2  
  for i over nodes: {
3  
    WebNode n = nodes.get(i);
4  
    double phi = (i/(double) (l(nodes)-1)+1.5)*pi();
5  
    double x = sin(phi), y = cos(phi);
6  
    n.x = 0.5+x*0.45;
7  
    n.y = 0.06+y*0.81;
8  
  }
9  
}

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: #1010377
Snippet name: web_placeNodesOnU - arrange nodes in a U shape
Eternal ID of this version: #1010377/7
Text MD5: 32c806889c715f6b8a73df5e9758d7e6
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-09-13 17:22:57
Source code size: 252 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 527 / 535
Version history: 6 change(s)
Referenced in: [show references]