Skip to content

Commit 127c4e3

Browse files
authored
Create README.md
1 parent 69c7379 commit 127c4e3

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Diff for: p5.arrow/README.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## p5.arrow
2+
3+
Utility function for drawing arrow in p5.js
4+
5+
![Preview](https://s2.gifyu.com/images/Peek-2021-02-08-09-27.gif)
6+
7+
Use arrow just like you use line and specify the size of the pointer as the last parameter.
8+
9+
Here is the code for the above visualization
10+
11+
```
12+
let t=0;
13+
14+
function setup() {
15+
createCanvas(400, 400);
16+
}
17+
18+
function draw() {
19+
background(0);
20+
translate(width/2, height/2)
21+
stroke(255)
22+
strokeWeight(3)
23+
arrow(0,0, 100*sin(t), 100*cos(t),10)
24+
t+=0.05;
25+
}
26+
```

0 commit comments

Comments
 (0)