Tuesday, November 19, 2024
Google search engine
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 Rubhabha-Wardslaus
Dominic Rubhabha-Wardslaushttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Recent Comments