# Math Library for p5 js

**URL:** https://discourse.processing.org/t/math-library-for-p5-js/10037
**Category:** Summer of Code
**Created:** [April 6, 2019, 6:14pm UTC](https://discourse.processing.org/t/math-library-for-p5-js/10037 "2019-04-06T18:14:56Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![bhaskar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/bhaskar/32/3949_2.png) [@bhaskar](https://discourse.processing.org/u/bhaskar)
#### Post date: [April 6, 2019, 6:14pm UTC](https://discourse.processing.org/t/math-library-for-p5-js/10037/1 "2019-04-06T18:14:56Z")

</div>

Hi everyone,

I am trying to create a maths library for p5.js here is the [repository link](https://github.com/singhbhaskar/p5.js-math-library). Please watch and give some comments and suggestions as it will be a great help for development. I appreciate all for you comments and suggestions in advanced.

PS - This project is done as a part of Google Summer of Code.

---

<div class="post-metadata">

### Author: ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)
#### Post date: [April 7, 2019, 1:35am UTC](https://discourse.processing.org/t/math-library-for-p5-js/10037/2 "2019-04-07T01:35:13Z")

</div>

and why

> createMatrix(1, 2, 3, 4)

not allow a mat2 matrix?

* * *

sorry, i not like that style  
9 arg are 3 x 3  
16 arg are 4 x 4  
else error  
i not see that as a general approach to matrix math.

but i just take a short look so i might misunderstand the whole thing  
, sorry

---

<div class="post-metadata">

### Author: ![bhaskar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/bhaskar/32/3949_2.png) [@bhaskar](https://discourse.processing.org/u/bhaskar)
#### Post date: [April 7, 2019, 8:21am UTC](https://discourse.processing.org/t/math-library-for-p5-js/10037/3 "2019-04-07T08:21:39Z")

</div>

Hi @kll, You can also define the dimensions for matrix and then pass an array containing the values for matrix. You also create an identity matrix also by using the functions which is going to be implemented soon  
Thanks for you feedback

---

<div class="post-metadata">

### Author: ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)
#### Post date: [April 7, 2019, 9:03am UTC](https://discourse.processing.org/t/math-library-for-p5-js/10037/4 "2019-04-07T09:03:37Z")

</div>

> [@bhaskar](#):
>
> You can also define the dimensions for matrix and then pass an array containing the values for matrix.

oh, i did not see that one, i like it!
