1 | static DoublePt calAverageCenter(CirclesAndLines cal) {
|
2 | int n = l(cal.circles); |
3 | if (n == 0) null; |
4 | double x = 0, y = 0; |
5 | for (Circle c : cal.circles) {
|
6 | x += c.x; y += c.y; |
7 | } |
8 | ret DoublePt(x/n, y/n); |
9 | } |
Began life as a copy of #1009850
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: | #1009852 |
| Snippet name: | calAverageCenter |
| Eternal ID of this version: | #1009852/2 |
| Text MD5: | 3ecf7b2459af0ed68eacd98edede02c4 |
| Author: | stefan |
| Category: | javax / a.i. / gui |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2017-08-21 22:32:12 |
| Source code size: | 221 bytes / 9 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 722 / 759 |
| Version history: | 1 change(s) |
| Referenced in: | [show references] |