We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I want to explore some of the geometrical aspects of complex numbers through p5. What are some ways to go about this?
@pwii -- if you intend to represent the components of your complex numbers as x,y vectors, then use p5.Vector:
p5.js doesn't bundle any class to deal w/ complex numbers. You're gonna need to find another library for it and use it together w/ p5.js.
I've done a quick search on GitHub and found 2:
If you pick up library Complex, here's an "index.html" template for it:
<script async src=http://CDN.JSDelivr.net/npm/p5></script> <script defer src=http://CDN.JSDelivr.net/npm/complex/lib/Complex.min.js></script> <script defer src=sketch.js></script>
And for library Complex.js version:
<script async src=http://CDN.JSDelivr.net/npm/p5></script> <script defer src=http://CDN.JSDelivr.net/npm/complex.js/complex.min.js></script> <script defer src=sketch.js></script>
Notice though library Complex.js belongs to a much bigger 1 called Math.js: http://MathJS.org/docs/datatypes/complex_numbers.html
If you prefer to get everything, this is the template for it: O:-)
<script async src=http://CDN.JSDelivr.net/npm/p5></script> <script defer src=http://CDN.JSDelivr.net/npm/mathjs/dist/math.min.js></script> <script defer src=sketch.js></script>
Sorry for the late response! This is everything I asked for :)! Where did you get the link for the mathjs library?
Where did you get the link for the Math.js library?
Answers
@pwii -- if you intend to represent the components of your complex numbers as x,y vectors, then use p5.Vector:
p5.js doesn't bundle any class to deal w/ complex numbers.
You're gonna need to find another library for it and use it together w/ p5.js.
I've done a quick search on GitHub and found 2:
If you pick up library Complex, here's an "index.html" template for it:
And for library Complex.js version:
Notice though library Complex.js belongs to a much bigger 1 called Math.js:
http://MathJS.org/docs/datatypes/complex_numbers.html
If you prefer to get everything, this is the template for it: O:-)
Sorry for the late response! This is everything I asked for :)! Where did you get the link for the mathjs library?
http://CDN.JSDelivr.net/npm/mathjs/
http://CDN.JSDelivr.net/npm/mathjs/dist/