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

7
LINES

< > BotCompany Repo | #1033052 // spreadEvenly

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

Libraryless. Click here for Pure Java version (4018L/23K).

static double[] spreadEvenly(int n, DoubleRange r) {
  double len = l(r);
  double[] a = new[n];
  for i to n:
    a[i] = doubleRatio(i*len, n-1);
  ret a;
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1033052
Snippet name: spreadEvenly
Eternal ID of this version: #1033052/2
Text MD5: 5221bbc901cda7b5c79faf694307a5ee
Transpilation MD5: b426ee3d0f0e5196e03828a6ffe12f36
Author: stefan
Category: javax / maths
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-11 19:10:45
Source code size: 163 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 148 / 221
Version history: 1 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)