Sunday, February 22, 2026
HomeLanguagesJavascriptFabric.js qrDecompose() Method

Fabric.js qrDecompose() Method

The qrDecompose() method is used to decompose the specified standard 2×3 matrix into transform components

Syntax:

qrDecompose( mat )

Parameters: This method accepts a parameter as mentioned above and described below:

  • mat: This parameter holds the specified array of transform matrix.

Return Value: This method returns the components of transform.

Example 1:

Javascript




<!DOCTYPE html>
<html>
  
<head>
    <!-- Adding the FabricJS library -->
    <script src=
    </script>
</head>
  
<body>
    <script type="text/javascript">
  
        // Calling qrDecompose() function over
        // the specified array of transform matrix
        console.log(fabric.util
            .qrDecompose([1, 2, 3, 4, 5, 6]));
    </script>
</body>
  
</html>


Output:

{"angle":63.434948822922,"scaleX":2.23606797749979,"scaleY":-0.8944271909999159,
"skewX":65.55604521958347,"skewY":0,"translateX":5,"translateY":6}

Example 2:

Javascript




<!DOCTYPE html>
<html>
  
<head>
  
    <!-- Adding the FabricJS library -->
    <script src=
    </script>
</head>
  
<body>
    <script type="text/javascript">
  
        // Specifying some array of transform matrix
        var a1 = [1, 2, 3];
        var a2 = [0, 6, 7, 8, 0, 0];
  
        // Calling qrDecompose() function over the
        // above specified array of transform matrix
        console.log(fabric.util.qrDecompose(a1));
        console.log(fabric.util.qrDecompose(a2));
    </script>
  
</body>
  
</html>


Output:

{"angle":63.434948822922,"scaleX":2.23606797749979,"scaleY":null,"skewX":null,"skewY":0}
{"angle":90,"scaleX":6,"scaleY":-7,"skewX":53.13010235415598,"skewY":0,
"translateX":0,"translateY":0}
Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32506 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6882 POSTS0 COMMENTS
Nicole Veronica
12005 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12099 POSTS0 COMMENTS
Shaida Kate Naidoo
7011 POSTS0 COMMENTS
Ted Musemwa
7255 POSTS0 COMMENTS
Thapelo Manthata
6967 POSTS0 COMMENTS
Umr Jansen
6956 POSTS0 COMMENTS