Curriculum
Course: Java Basic
Login

Curriculum

Java Basic

Java Home

0/1

Java Introduction

0/1

Java Get Started

0/1

Java Syntax

0/1

Java Comments

0/1

Java Type Casting

0/1

Java Operators

0/1

Java Booleans

0/1

Java Switch

0/1

Java Break / Continue

0/1

Java Errors and Exception

0/1
Text lesson

toDegrees()

Example

Transform angles measured in radians into degrees for various values.

System.out.println(Math.toDegrees(1));
System.out.println(Math.toDegrees(Math.PI));
System.out.println(Math.toDegrees(Math.PI / 4));
System.out.println(Math.toDegrees(-0.5236));
System.out.println(Math.toDegrees(6));

Definition and Usage

The toDegrees() method converts angles from radians to degrees.

Tip: To convert from degrees to radians, refer to the to radians method.

Syntax

public static double toDegrees(double angle)

Parameter Values

Parameters

Description

angle

“Necessary. An angle expressed in radians.”

Technical Details

Returns:

“A double value indicating an angle measured in degrees.”

Java Version:

1.2+