Fabric.js sin() Method
Last Updated :
03 Mar, 2021
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" >
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" >
var a = -1;
var b = 0.6;
console.log(fabric.util.sin(a));
console.log(fabric.util.sin(b));
</script>
</body>
</html>
|
Output:
-0.8414709848078965
0.5646424733950354
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...