博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
strictmath_Java StrictMath toDegrees()方法与示例
阅读量:2542 次
发布时间:2019-05-11

本文共 2508 字,大约阅读时间需要 8 分钟。

strictmath

StrictMath类toDegrees()方法 (StrictMath Class toDegrees() method)

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

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

  • toDegrees() method is used to convert the given angle from radians to degrees or in other words, this method is used to convert an angle measured in radians to an equivalent angle measured in degrees.

    toDegrees()方法用于将给定角度从弧度转换为度,换句话说,该方法用于将以弧度测量的角度转换为以度为单位的等效角度。

  • toDegrees() method is a static method so it is accessible with the class name and if we try to access the method with the class object then we will not get any error.

    toDegrees()方法是一个静态方法,因此可以使用类名进行访问,如果尝试使用类对象访问该方法,则不会出现任何错误。

  • toDegrees() method does not throw any exception at the time of conversion of angle from radians to degrees.

    从弧度到度的角度转换时, toDegrees()方法不会引发任何异常。

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

    通常将角度从弧度转换为角度的结果不准确。

Syntax:

句法:

public static double toDegrees(double ang_in_rad);

Parameter(s):

参数:

  • double ang_in_rad – represents an angle in radians.

    double ang_in_rad –表示弧度的角度。

Return value:

返回值:

The return type of this method is double – it returns the degrees converted value of the given angle (in radians).

此方法的返回类型为double-返回给定角度的度数转换值(以弧度为单位)。

Example:

例:

// Java program to demonstrate the example of // toDegrees(double ang_in_rad) method of StrictMath classpublic class ToDegrees {
public static void main(String[] args) {
// Variable Declarations double d1 = 60; double d2 = -60; double d3 = 90; double d4 = -90; // Display previous value of d1,d2,d3 and d4 System.out.println("d1: " + d1); System.out.println("d2: " + d2); System.out.println("d3: " + d3); System.out.println("d4: " + d4); // By using toDegrees() method is used to convert the //given angle from radians into degrees d1 = StrictMath.toDegrees(d1); d2 = StrictMath.toDegrees(d2); d3 = StrictMath.toDegrees(d3); d4 = StrictMath.toDegrees(d4); System.out.println("StrictMath.toDegrees(d1): " + d1); System.out.println("StrictMath.toDegrees(d2): " + d2); System.out.println("StrictMath.toDegrees(d3): " + d3); System.out.println("StrictMath.toDegrees(d4): " + d4); }}

Output

输出量

d1: 60.0d2: -60.0d3: 90.0d4: -90.0StrictMath.toDegrees(d1): 3437.746770784939StrictMath.toDegrees(d2): -3437.746770784939StrictMath.toDegrees(d3): 5156.620156177409StrictMath.toDegrees(d4): -5156.620156177409

翻译自:

strictmath

转载地址:http://ipvzd.baihongyu.com/

你可能感兴趣的文章
POJ1426:Find The Multiple(算是bfs水题吧,投机取巧过的)
查看>>
今天突然出现了Property IsLocked is not available for Login '[sa]',我太阳,下面有绝招对付它!...
查看>>
django-admin源码解析
查看>>
pc端字体大小自适应几种方法
查看>>
Linux--Linux下安装JDk
查看>>
Github windows客户端简单上手教程
查看>>
前端面试题:高效地随机选取数组中的元素
查看>>
[.NET] 使用 .NET Framework 開發 ActiveX Control
查看>>
Remote IIS Debugging : Debug your ASP.NET Application which is hosted on "Remote IIS Server"
查看>>
iframe 模拟ajax文件上传and formdata ajax 文件上传
查看>>
个人作品需要的报告
查看>>
7 月 2 日
查看>>
那些盒模型在IE6中的BUG们,工程狮的你可曾遇到过?
查看>>
JVM学习笔记四_垃圾收集器与内存分配策略
查看>>
使用Entity Framwork 保存数据时,提示不能在对象中插入重复键,违反了PRIMARY_KEY约束...
查看>>
Mac上制作Centos7系统U盘安装盘
查看>>
VS2013 堆栈溢出调查(0xC00000FD: Stack overflow)
查看>>
Appium脚本(2):元素检测
查看>>
python之OrderedDict类
查看>>
设置和获取函数体现的软件工程
查看>>