带有示例的 Scala Float toDegrees() 方法
toDegrees()方法用于将以弧度测量的角度转换为以度为单位测量的大致等效角度。
Method Definition: (Number).toDegrees
Return Type: It returns the converted value of degrees.
示例 #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