# transformationMatrix.decompose

**URL:** <https://forum.babylonjs.com/t/transformationmatrix-decompose/17244>\
**Category:** Questions\
**Created:** [January 6, 2021, 7:21pm UTC](https://forum.babylonjs.com/t/transformationmatrix-decompose/17244 "2021-01-06T19:21:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Z\_J](https://avatars.discourse-cdn.com/v4/letter/z/e99b99/32.png) [@Z\_J](https://forum.babylonjs.com/u/Z_J)\
**Post date:** [January 6, 2021, 7:21pm UTC](https://forum.babylonjs.com/t/transformationmatrix-decompose/17244/1 "2021-01-06T19:21:20Z")

</div>

Hi,

Can anyone explain what does hitTest.transformationMatrix.decompose do in the below playground?

> **[Babylon.js Playground](https://playground.babylonjs.com/#KDWCZY)**

---

<div class="post-metadata">

**Author:** ![slin](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/slin/32/36084_2.png) [@slin](https://forum.babylonjs.com/u/slin)\
**Post date:** [January 6, 2021, 9:41pm UTC](https://forum.babylonjs.com/t/transformationmatrix-decompose/17244/2 "2021-01-06T21:41:53Z")

</div>

Hi,

A transformation matrix is applying scaling, quaternion rotation, and position. As shown in the documentation for static method Matrix.compose(). [Matrix | Babylon.js Documentation](https://doc.babylonjs.com/typedoc/classes/babylon.matrix#Compose)

decompose is to extract the scaling, rotation, and position out from the transformation.

e.g. hitTest.transformationMatrix.decompose(undefined, b.rotationQuaternion, b.position);

It extracts the rotation and position, and since the code is not interested in retrieving the scaling. undefined is passed into the function.
