summaryrefslogtreecommitdiff
path: root/www/js/p5_custom.js
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2021-10-04 12:09:34 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2021-10-04 12:09:34 +0200
commit91cb075a19ee199b7959e9a7e578550d624d462f (patch)
treed69e94e6c918738066875b0b5d82b1db18a32269 /www/js/p5_custom.js
parent18d860cff5230576e76c80a5cc2d3442165be4a1 (diff)
Cleaning
Diffstat (limited to 'www/js/p5_custom.js')
-rw-r--r--www/js/p5_custom.js15
1 files changed, 0 insertions, 15 deletions
diff --git a/www/js/p5_custom.js b/www/js/p5_custom.js
deleted file mode 100644
index b25e636..0000000
--- a/www/js/p5_custom.js
+++ /dev/null
@@ -1,15 +0,0 @@
-
-draw_arrow=function(p,x1,y1,x2,y2){
- p.push()
- p.strokeWeight(5)
- p.line(x1,y1,x2,y2)
- offset=5
- var angle = p.atan2(y1 - y2, x1 - x2); //gets the angle of the line
- p.translate(x2, y2); //translates to the destination vertex
- p.rotate(angle-p.HALF_PI); //rotates the arrow point
- p.triangle(-offset*0.8, offset, offset*0.8, offset, 0, -offset/2); //draws the arrow point as a triangle
- p.pop();
-
- // Return the center of the arrow
- return(p.createVector(x1+(x2-x1)/2,y1+(y2-y1)/2))
-}