日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > java >内容正文

java

Java Math类toDegrees()方法与示例

發(fā)布時(shí)間:2023/12/1 java 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Java Math类toDegrees()方法与示例 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

數(shù)學(xué)類toDegrees()方法 (Math class toDegrees() method)

  • toDegrees() method is available in java.lang package.

    toDegrees()方法在java.lang包中可用。

  • toDegrees() method is used to convert an angle from radians to degrees.

    toDegrees()方法用于將角度從弧度轉(zhuǎn)換為度。

  • toDegrees() method is a static method, it is accessible with the class name too.

    toDegrees()方法是一個(gè)靜態(tài)方法,也可以使用類名進(jìn)行訪問。

  • toDegrees() method does not throw any exception.

    toDegrees()方法不會(huì)引發(fā)任何異常。

Note: The result of conversion an angle from radians to degrees is not generally exact.

注意:將角從弧度轉(zhuǎn)換為度的結(jié)果通常不準(zhǔn)確。

Syntax:

句法:

public static double toDegrees(double angle_in_radians);

Parameter(s):

參數(shù):

  • angle_in_radians – represents the values of an angle in radians.

    angle_in_radians –表示以弧度為單位的角度值。

Return value:

返回值:

The return type of this method is double – it returns the converted angle from radians to degrees.

這種方法的返回類型是雙 -它返回從弧度到度轉(zhuǎn)換后的角度。

Java程序演示toDegrees()方法的示例 (Java program to demonstrate example of toDegrees() method)

// Java program to demonstrate the example of // toDegrees(double angle_in_radians) method of Math Classpublic class ToDegreesMethod {public static void main(String[] args) {// declaring the variablesdouble d1 = 60;double d2 = -60;double d3 = 90;double d4 = -90;// displaying the valuesSystem.out.println("Angel values in radians...");System.out.println("d1: " + d1);System.out.println("d2: " + d2);System.out.println("d3: " + d3);System.out.println("d4: " + d4);// converting angel value from radians to degreesd1 = Math.toDegrees(d1);d2 = Math.toDegrees(d2);d3 = Math.toDegrees(d3);d4 = Math.toDegrees(d4);System.out.println("Angel values in degrees...");System.out.println("d1: " + d1);System.out.println("d2: " + d2);System.out.println("d3: " + d3);System.out.println("d4: " + d4);} }

Output

輸出量

E:\Programs>javac ToDegreesMethod.java E:\Programs>java ToDegreesMethod Angel values in radians... d1: 60.0 d2: -60.0 d3: 90.0 d4: -90.0 Angel values in degrees... d1: 3437.746770784939 d2: -3437.746770784939 d3: 5156.620156177409 d4: -5156.620156177409

翻譯自: https://www.includehelp.com/java/math-class-todegrees-method-with-example.aspx

創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)

總結(jié)

以上是生活随笔為你收集整理的Java Math类toDegrees()方法与示例的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。