Open In App

Scala Float toDegrees() method with example

Last Updated : 29 Oct, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

The toDegrees() method is utilized to converts an angle measured in radians to an approximately equivalent angle measured in degrees.

Method Definition: (Number).toDegrees

Return Type: It returns the converted value of degrees.

Example #1:




// Scala program of Float toDegrees()
// method
  
// Creating object
object GfG
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying toDegrees method
        val result = (56).toDegrees
          
          
        // Displays output
        println(result)
      
    }


Output:

3208.5637

Example #2:




// Scala program of Float toDegrees()
// method
  
// Creating object
object GfG
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying toDegrees method
        val result = (3.14).toDegrees
          
          
        // Displays output
        println(result)
      
    }


Output:

179.90874767107852


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads