# Multiply Matrix and Point to apply transformation

**URL:** <https://discourse.processing.org/t/multiply-matrix-and-point-to-apply-transformation/21874>\
**Category:** Coding Questions\
**Created:** [June 14, 2020, 8:39pm UTC](https://discourse.processing.org/t/multiply-matrix-and-point-to-apply-transformation/21874 "2020-06-14T20:39:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stephanschulz](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@stephanschulz](https://discourse.processing.org/u/stephanschulz)\
**Post date:** [June 14, 2020, 8:39pm UTC](https://discourse.processing.org/t/multiply-matrix-and-point-to-apply-transformation/21874/1 "2020-06-14T20:39:49Z")

</div>

openframeworks has makeRotationMatrix, makeTranslationMatrix, etc. and apply it to any stored coordinate.

p5js has applyMatirx() but it applies to the elements being drawn not to variables.  
It seems [http://glmatrix.net](http://glmatrix.net) might have those options.

I was not successful using these examples [https://developer.mozilla.org/en-US/docs/Web/API/WebGL\_API/Matrix\_math\_for\_the\_web](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Matrix_math_for_the_web)  
and do `var new_p = MDN.multiplyMatrixAndPoint(transformMatrix_0, old_p);`

I ultimately want to loop through a bunch of coordinates and angles collect rotation and translation matrices and apply those later.

thanks for any advice.
