Cos
Docslocal retval = Cos(value)Description
Returns the cosine of the given number.
Parameters
| Name | Type | Description |
|---|---|---|
value | float | The number of degrees (in degrees, not radians) |
Returns
floatReturns a floating-point number.
Examples
Official
-- Get the heading
local heading = GetEntityHeading(PlayerPedId())
local cos = Cos(heading)
-- equivalent in lua
local cosLua = math.cos(heading * (math.pi / 180))