Thursday, September 4, 2025
HomeLanguagesJavascriptFabric.js sin() Method

Fabric.js sin() Method

The sin() method is used to return the sine of a specified angle expressed in radians or degrees which is in range [-inf, +inf]. The returned value is in range [-1, +1]

Syntax:

sin( angle )

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

  • angle: This parameter holds the specified angle in radians or degrees.

Return Value: This method returns the value in the range of -1 to +1.

Example 1:

Javascript




<!DOCTYPE html>
 
<html>
 
<head>
    <!-- Adding the FabricJS library -->
    <script src=
    </script>
</head>
 
<body>
    <script type="text/javascript">
 
        // Calling sin() function over
        // specified angles of 0 and 5
        console.log(fabric.util.sin(0));
        console.log(fabric.util.sin(5));
    </script>
 
</body>
 
</html>


Output:

0
-0.9589242746631385

Example 2:

Javascript




<!DOCTYPE html>
 
<html>
 
<head>
    <!-- Adding the FabricJS library -->
    <script src=
    </script>
</head>
 
<body>
    <script type="text/javascript">
 
        // Specifying some angles
        var a = -1;
        var b = 0.6;
 
        // Calling sin() function over
        // above specified angles
        console.log(fabric.util.sin(a));
        console.log(fabric.util.sin(b));
    </script>
</body>
 
</html>


Output:

-0.8414709848078965
0.5646424733950354
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!
RELATED ARTICLES

Most Popular

Dominic
32264 POSTS0 COMMENTS
Milvus
81 POSTS0 COMMENTS
Nango Kala
6632 POSTS0 COMMENTS
Nicole Veronica
11800 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11859 POSTS0 COMMENTS
Shaida Kate Naidoo
6749 POSTS0 COMMENTS
Ted Musemwa
7025 POSTS0 COMMENTS
Thapelo Manthata
6698 POSTS0 COMMENTS
Umr Jansen
6718 POSTS0 COMMENTS