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

7
LINES

< > TinyBrain | #1005804 - pointDistance - distance between two points (Pt)

JavaX fragment (include)

static double pointDistance(Pt a, Pt b) {
  ret sqrt(sqr(a.x-b.x) + sqr(a.y-b.y));
}

static double pointDistance(double x1, double y1, double x2, double y2) {
  ret sqrt(sqr(x1-x2) + sqr(y1-y2));
}

download  show line numbers  debug dex   

Travelled to 3 computer(s): cfunsshuasjs, sawdedvomwva, tvejysmllsmz

No comments. add comment

Snippet ID: #1005804
Snippet name: pointDistance - distance between two points (Pt)
Eternal ID of this version: #1005804/4
Text MD5: 00d1dab9a3e386ae33401a13dfe44e9a
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-09-14 04:32:20
Source code size: 204 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 60 / 37
Version history: 3 change(s)
Referenced in: [show]