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

11
LINES

< > BotCompany Repo | #1032054 // center

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

Libraryless. Click here for Pure Java version (5194L/29K).

1  
static double center(DoubleRange r) {
2  
  ret (r.start+r.end)/2;
3  
}
4  
5  
static Pt center(Rect r) {
6  
  ret centerOfRect(r);
7  
}
8  
9  
static Pt center(int w, int h) {
10  
  ret pt(w/2, h/2);
11  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1032054
Snippet name: center
Eternal ID of this version: #1032054/3
Text MD5: 25982370b00a19e8febf250169d0e899
Transpilation MD5: f244e9d42268b0745158c9e035fff6f6
Author: stefan
Category: javax / maths
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-17 18:40:51
Source code size: 183 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 187 / 281
Version history: 2 change(s)
Referenced in: [show references]