bugl
bugl
HomeLearnPatternsPathsSearch
HomeLearnPatternsPathsSearch

Loading lesson path

Learn/Java/Java Reference
Java•Java Reference

Java Math cos() Method

Flash cards

Review the key moves

1/4
Core idea

What is the main idea behind Java Math cos() Method?

Lesson checks

Practice each idea before moving on

Short Mimo-style checks built from this lesson's code, terms, and sequence.

1Quick choice

Which statement best captures the main point of this lesson?

2Fill blank

Complete the missing token from the example code.

___.out.println(Math.cos(3));
3Order

Put the learning moves in the order that makes the concept easiest to apply.

The cos() method returns the cosine of an angle.
Definition and Usage
Java Math cos() Method

❮ Math Methods

Example

System.out.println(Math.cos(3));
System.out.println(Math.cos(-3));
System.out.println(Math.cos(0));
System.out.println(Math.cos(Math.PI));
System.out.println(Math.cos(Math.PI/2));

Definition and Usage

The cos() method returns the cosine of an angle.

Note

Angles are measured in radians.

Tip

You can use the constant Math.PI to make fractions of PI for angles.

Syntax

public static double cos(double
angle )

Parameter Values

ParameterDescription
angleRequired. An angle in radians to find the cosine of.

Technical Details

Returns:A double value representing the cosine of an angle.
Java version:Any

Previous

Java Math copySign() Method

Next

Java Math cosh() Method