Skip to content

format

typescript
Mathf.Cos(rad)

class: Mathf

description

Returns the cosine value of the angle in radians.

parameter

param_nametypedescription
radnumberThe angle in radians.

return

typedescription
numberThe cosine value of the angle (returns a value between -1 and 1).

code example

typescript
// Calculate the cosine of val
let cos = Mathf.Cos(0) // cos = 1