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

11
LINES

< > BotCompany Repo | #1034951 // threePointAngle

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

Transpiled version (50L) is out of date.

// angle between p1 and p2 with respect to center point
// result is between 0 and pi()*2
static double threePointAngle(IDoublePt p1, IDoublePt center, IDoublePt p2) {
  double angle = atan2(
      p1.x_double()-center.x_double(),
      p1.y_double()-center.y_double())
    -atan2(
      p2.x_double()-center.x_double(),
      p2.y_double()-center.y_double());
  ret mod(angle, pi()*2);
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1034951
Snippet name: threePointAngle
Eternal ID of this version: #1034951/3
Text MD5: 151e64228f4d16a9e6edcf76d340cecd
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-17 21:17:28
Source code size: 398 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 79 / 115
Version history: 2 change(s)
Referenced in: [show references]