Claudia_ResearchPost5

p5.js Library: Dimension

This add-on to p5.js is intended to extend the p5 vector functions to any number of dimensions. The users can use as many points and dimensions as they like, as long as it’s less than 52. Currently I believe all the standard vector functions in p5 can be used in the same way using this add-on. The function used to do the calculations for sum of vectors:

result = nAdd(pos1, pos2);

And the vectors can be created like this:

var pos1 = nVector(int, int, int, int);

link to library: https://github.com/Smilebags/p5.dimensions.js

example of an animated rotating 4D hypercube: https://github.com/Smilebags/p5.dimensions.js/blob/master/libraries/p5.dimensions.js