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

acos()

Example

Provide the arccosine of various numbers.

System.out.println(Math.acos(0.64));
System.out.println(Math.acos(-0.4));
System.out.println(Math.acos(0));
System.out.println(Math.acos(1));
System.out.println(Math.acos(-1));
System.out.println(Math.acos(2))

Definition and Usage

The acos() method computes the arc cosine of a number.

Hint: The result of acos(-1) yields the value of π.

Syntax

public static double abs(double number)

Parameter Values

Parameter

Description

number

Mandatory. A number within the range of -1 to 1, for which the arc cosine is to be calculated. If the value falls outside this range, it returns NaN (Not a Number).

Technical Details

Returns:

A double value that represents the arc cosine of a number.