We are about to switch to a new forum software. Until then we have removed the registration on this forum.
When I try to use double, a lot of the functions like sq() don't accept doubles. Is there somewhere I can find equivalent functions for doubles?
Also, why don't PVectors accept doubles? Methods like pvector.mult(double) don't work. Any way around this?
Answers
https://Docs.Oracle.com/javase/10/docs/api/java/lang/Math.html
https://Forum.Processing.org/two/discussions/tagged/double
Yes, I feel your pain. This is something I wish would be changed in a future Processing - no real benefit to it.
So, you can use Math.* functions.
Also feel free to steal this (back) - https://github.com/praxis-live/praxis/blob/master/praxis.code/src/net/neilcsmith/praxis/code/userapi/PVector.java - refactored PVector to use
double
which I use in Praxis LIVE - I rewrote the whole Processing API to be based arounddouble
instead! :-)Also, don't forget to suffix all fractional literals w/
d
. Like this:2.7d
,-.5d
,1e3d
. L-)B/c for ".pde" files Processing's pre-processor automatically suffixes all fractional literals w/
f
if there's none already. :-\"Wow, no idea about that. Thanks for the heads up.
This is perfect. I need to take a look at Praxis live again. By the way, how do I incorporate it back into Processing as a library? First time doing something like this manually.