📜  带有示例的 Scala Float toDegrees() 方法

📅  最后修改于: 2022-05-13 01:55:22.279000             🧑  作者: Mango

带有示例的 Scala Float toDegrees() 方法

toDegrees()方法用于将以弧度测量的角度转换为以度为单位测量的大致等效角度。

示例 #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)
      
    }
} 
输出:
3208.5637

示例 #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)
      
    }
} 
输出:
179.90874767107852