Transpiled version (8142L) is out of date.
1 | static DoublePt lineIntersectionPt(LineThroughPoint l1, LineThroughPoint l2) { |
2 | DoublePt p1 = doublePt(l1.x, l1.y), p2 = l1.pointOnLine(1); |
3 | DoublePt p3 = doublePt(l2.x, l2.y), p4 = l2.pointOnLine(1); |
4 | double d = (p1.x-p2.x)*(p3.y-p4.y)-(p1.y-p2.y)*(p3.x-p4.x); |
5 | double x = ((p1.x*p2.y-p1.y*p2.x)*(p3.x-p4.x) |
6 | -(p1.x-p2.x)*(p3.x*p4.y-p3.y*p4.x))/d; |
7 | double y = ((p1.x*p2.y-p1.y*p2.x)*(p3.y-p4.y) |
8 | -(p1.y-p2.y)*(p3.x*p4.y-p3.y*p4.x))/d; |
9 | ret doublePt(x, y); |
10 | } |
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1035466 |
Snippet name: | lineIntersectionPt |
Eternal ID of this version: | #1035466/4 |
Text MD5: | af97f69e6bef40ccf36b4557241ce87f |
Author: | stefan |
Category: | javax / math |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-05-21 19:04:24 |
Source code size: | 479 bytes / 10 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 156 / 201 |
Version history: | 3 change(s) |
Referenced in: | [show references] |