Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doubt: PVector class analogous in Quill #361

Open
chagasVinicius opened this issue Feb 21, 2022 · 1 comment
Open

Doubt: PVector class analogous in Quill #361

chagasVinicius opened this issue Feb 21, 2022 · 1 comment

Comments

@chagasVinicius
Copy link

Hello everyone,
I am currently studying creative programming using Quill and I am enjoying it a lot. I am using the "Nature of Code" in my studies and in the book a series of interesting concepts of movement and physics are developed using the PVector class of Processing. I would like to ask if exists an interest to implement in Quill some kind of Clojure constructor analogous to the class?

@heyarne
Copy link
Contributor

heyarne commented May 28, 2022

Hi @chagasVinicius!
I don't speak officially here, but maybe I can still help. In general the Clojurians slack is more active should you ever get stuck and need an urgent answer.
Now to your question:
I find it simple enough to just use Clojure vectors. You can create them using [x y] and conveniently destructure them and create new ones wherever you need them. The quil API does the same in many places.
If you need more builtin methods, say you don't want to implement the maths yourself, maybe take a look at the thi.ng.geom or fastmath libraries, both of which provide a rich set of geometry data types and manipulations on them. They implement the right protocols, so using them may just be a drop-in replacement in many cases. My personal experience though is that it pays off to keep it simple, and using plain Clojure vectors until I hit performance bounaries is just fine.

Edit: I misread the issue as a question for advice, but I saw now that this is maybe more of an inquiry whether people would find it useful. I hope the comment still makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants