Fabric.js radiansToDegrees() Method

The radiansToDegrees() method is used to transform the specified radians value to its corresponding degrees value.
Syntax:
radiansToDegrees( radians )
Parameters: This method accepts a parameter as mentioned above and described below:
- radians: This parameter holds the specified radian values.
Return Value: This method returns the converted degree values.
Example 1:
HTML
<!DOCTYPE html><html><head> <!-- Adding the FabricJS library --> <script src= </script></head><body> <script type="text/javascript"> // Calling radiansToDegrees() function over // some specified radian values console.log(fabric.util.radiansToDegrees(1)); console.log(fabric.util.radiansToDegrees(5)); console.log(fabric.util.radiansToDegrees(8)); </script></body></html> |
Output:
57.29577951308232 286.4788975654116 458.3662361046586
Example 2:
HTML
<!DOCTYPE html><html><head> <!-- Adding the FabricJS library --> <script src= </script></head><body> <script type="text/javascript"> // Specifying some radian values var a = 1.2; var b = 0.45; // Calling radiansToDegrees() function over // the above specified radian values console.log(fabric.util.radiansToDegrees(a)); console.log(fabric.util.radiansToDegrees(b)); </script></body></html> |
Output:
68.75493541569878 25.783100780887047
Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, zambiatek 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!



