math.cos

Full name
math.cos
Library
math
Syntax

math.cos(x)

Description

The math.cos function returns the cosine of the angle included as an argument.

Parameters
  • x: Angle in radians whose cosine you want to obtain.
Result

The math.cos function returns a real number.

Examples

We can obtain the cosine of π with the following code:

math.cos(math.pi)

-1.0

Submitted by admin on Tue, 01/19/2021 - 16:11