---
url: >-
  /statelake/scripting-reference/functions-and-procedures/mathematical-functions/cos.md
---

# Cos

**Cos** is a trigonometric function that calculates angles.

**Cos** uses radians, and returns the **Cos** (or cosine) of the value given in the parameter **e**.

**e** is a radian value, where one (1) radian is calculated as 180 over Pi, and is equivalent to an angle of 57.29577951 degrees.

**Declaration**: Function Cos(e : Extended) : Extended

Several examples follow.

```pascal
procedure ScriptEvent (var Value : variant);
var
  aEx : extended;
begin
  LogInfo('');

 //Returns 'Cos 123 = -0.887968906691855'
  aEx:= Cos(123);
  LogInfo('Cos 123 = '+FloatToStr(aEx));

 //Returns 'Cos 180 = -0.598460069057858'
  aEx := Cos(180);
  LogInfo('Cos 180 = '+FloatToStr(aEx));

 //Returns 'Cos 1 = 0.54030230586814'
  aEx := Cos(1);
  LogInfo('Cos 1 = '+FloatToStr(aEx));

 //Returns 'Cos 2 = 0.416146836547142'
  aEx := Cos(2);
  LogInfo('Cos 2 = '+FloatToStr(aEx));

 //Returns 'Cos -1 = -0.54030230586814'
  aEx := Cos(-1);
  LogInfo('Cos -1 = '+FloatToStr(aEx));

  LogInfo('');
end;
```

Please also refer to [Sin](/statelake/scripting-reference/functions-and-procedures/mathematical-functions/sin).
