# My First Feedback (and a suggestion for a standard function for p5.js)

**URL:** <https://discourse.processing.org/t/my-first-feedback-and-a-suggestion-for-a-standard-function-for-p5-js/9798>\
**Category:** p5.js\
**Created:** [March 30, 2019, 5:38pm UTC](https://discourse.processing.org/t/my-first-feedback-and-a-suggestion-for-a-standard-function-for-p5-js/9798 "2019-03-30T17:38:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![NeilTheSeal](https://avatars.discourse-cdn.com/v4/letter/n/a8b319/32.png) [@NeilTheSeal](https://discourse.processing.org/u/NeilTheSeal)\
**Post date:** [March 30, 2019, 5:38pm UTC](https://discourse.processing.org/t/my-first-feedback-and-a-suggestion-for-a-standard-function-for-p5-js/9798/1 "2019-03-30T17:38:52Z")

</div>

Hi to the community, I have begun making p5.js sketches recently to help instruct math and science at my university, and it’s perfect for our applications. So first of all, thanks to all the contributors and our friends at the Processing Foundation.

Anyways - it occurred to me that there is no 2D primitive for arrows. I will be drawing my arrows using a series of three line() functions (or maybe a line and triangle), but it would be super convenient if we added a standard 2D primitive for that, along with some function to control the size of the arrowhead and/or whether it is a 2-sided arrow or not.

I hope this is the right place to send my suggestions? Input appreciated 🙂

---

<div class="post-metadata">

**Author:** ![figraham](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/figraham/32/4161_2.png) [@figraham](https://discourse.processing.org/u/figraham)\
**Post date:** [March 31, 2019, 3:42am UTC](https://discourse.processing.org/t/my-first-feedback-and-a-suggestion-for-a-standard-function-for-p5-js/9798/2 "2019-03-31T03:42:04Z")

</div>

Great to hear about your use of p5.js! Sounds like a useful feature to me. But actually the best place to ask for features is over on the [GitHub page by making an issue](https://github.com/processing/p5.js/issues). It’s fairly self explanatory from then on. If you don’t have a GitHub account I’d be happy to make the request for you just let me know.

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [March 31, 2019, 3:42am UTC](https://discourse.processing.org/t/my-first-feedback-and-a-suggestion-for-a-standard-function-for-p5-js/9798/3 "2019-03-31T03:42:10Z")

</div>

> **[processing/p5.js](https://github.com/processing/p5.js/issues)**
>
> p5.js is a client-side JS platform that empowers artists, designers, students, and anyone to learn to code and express themselves creatively on the web. It is based on the core principles of Proces...

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [March 31, 2019, 9:19pm UTC](https://discourse.processing.org/t/my-first-feedback-and-a-suggestion-for-a-standard-function-for-p5-js/9798/4 "2019-03-31T21:19:59Z")

</div>

An arrow isn’t a geometric drawing primitive, like a line or a rect. To me it doesn’t make sense to configure one with global settings (like stroke) --each arrow is a complex object with multiple configuration settings for its head, tail, and line, and many uses of arrow would have different setting for each instance.

For that reason I would be surprised if this became a built-in to the core library, even though drawing arrows is really useful. Instead, drawing arrows strikes me as a perfect example of a p5.js library – for example, like a diagramming library.

[https://modeling-languages.com/javascript-drawing-libraries-diagrams/](https://modeling-languages.com/javascript-drawing-libraries-diagrams/)

Then all the things people want – single head, double head, hollow or filled, UML-style, ball-caps, curved line, orthogonal-line, etc. – could all be included as features of that library.

In the meantime, I would suggest creating a simple arrow class rather than a function.

---

<div class="post-metadata">

**Author:** ![NeilTheSeal](https://avatars.discourse-cdn.com/v4/letter/n/a8b319/32.png) [@NeilTheSeal](https://discourse.processing.org/u/NeilTheSeal)\
**Post date:** [April 1, 2019, 2:19am UTC](https://discourse.processing.org/t/my-first-feedback-and-a-suggestion-for-a-standard-function-for-p5-js/9798/5 "2019-04-01T02:19:59Z")

</div>

This makes a lot of sense, actually! If I ever feel ambitious, I might just build that 🙂  
FYI I ended up doing a line+triangle, with a couple conditionals to make it scale correctly. Works great, but won’t work in all applications unfortunately
