Libraryless. Click here for Pure Java version (4018L/23K).
1 | static double[] spreadEvenly(int n, DoubleRange r) {
|
2 | double len = l(r); |
3 | double[] a = new[n]; |
4 | for i to n: |
5 | a[i] = doubleRatio(i*len, n-1); |
6 | ret a; |
7 | } |
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: | 363 / 467 |
| Version history: | 1 change(s) |
| Referenced in: | [show references] |