Method

# Cos

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

Returns the cosine of the given angle.

## Usage

``` xojo
result = Cos(value)
```

| Part   | Type                             | Description                                    |
|--------|----------------------------------|------------------------------------------------|
| result | `Double</api/data_types/double>` | The cosine of *value*.                         |
| value  | `Double</api/data_types/double>` | The value (in radians) you want the cosine of. |

## Notes

The <span class="title-ref">Cos</span> function returns the cosine of the angle (in radians) passed to it. If the angle is in degrees, multiply it by PI/180 to convert it to radians.

## Sample code

This code uses the <span class="title-ref">Cos</span> function to return the cosine of an angle.

``` xojo
Var d As Double
Const Pi = 3.14159
d = Cos(45 * Pi / 180) ' returns 0.707
```

## Compatibility

|                       |     |
|-----------------------|-----|
| **Project Types**     | All |
| **Operating Systems** | All |

<div class="seealso">

`Acos</api/math/acos>` function

</div>
