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

10
LINES

< > BotCompany Repo | #1033485 // graphAsPolygon

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (4638L/26K).

1  
static L<DoublePt> lambdaMapLike graphAsPolygon(IF1<Double> formula, int w, int h) {
2  
  new L<DoublePt> points;
3  
  points.add(DoublePt(0, 0));
4  
  for x to w: {
5  
    double y = formula.get(doubleRatio(x, w))*h;
6  
    points.add(DoublePt(x, y));
7  
  }
8  
  points.add(DoublePt(w-1, 0));
9  
  ret points;
10  
}

Author comment

Began life as a copy of #1016056

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1033485
Snippet name: graphAsPolygon
Eternal ID of this version: #1033485/3
Text MD5: 3cdffdfb733a640f16ed9812215ee78e
Transpilation MD5: bd5f2ed3bb0f2fb156b112bc9e3cae09
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-29 03:24:03
Source code size: 298 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 157 / 230
Version history: 2 change(s)
Referenced in: [show references]