* Fix various docs errors around std module Signed-off-by: Nick Cameron <nrc@ncameron.org> * remove KCL from lang docs titles and move settings docs Signed-off-by: Nick Cameron <nrc@ncameron.org> * Include functions declared in Rust in module docs Signed-off-by: Nick Cameron <nrc@ncameron.org> --------- Signed-off-by: Nick Cameron <nrc@ncameron.org>
45 lines
91 KiB
Markdown
45 lines
91 KiB
Markdown
---
|
|
title: "cos"
|
|
subtitle: "Function in std::math"
|
|
excerpt: "Compute the cosine of a number."
|
|
layout: manual
|
|
---
|
|
|
|
Compute the cosine of a number.
|
|
|
|
```kcl
|
|
cos(@num: number(Angle)): number(_)
|
|
```
|
|
|
|
|
|
|
|
### Arguments
|
|
|
|
| Name | Type | Description | Required |
|
|
|----------|------|-------------|----------|
|
|
| `num` | `number(Angle)` | | Yes |
|
|
|
|
### Returns
|
|
|
|
`number(_)`
|
|
|
|
|
|
### Examples
|
|
|
|
```kcl
|
|
exampleSketch = startSketchOn(XZ)
|
|
|> startProfile(at = [0, 0])
|
|
|> angledLine(
|
|
angle = 30,
|
|
length = 3 / cos(30deg),
|
|
)
|
|
|> yLine(endAbsolute = 0)
|
|
|> close()
|
|
|
|
example = extrude(exampleSketch, length = 5)
|
|
```
|
|
|
|

|
|
|
|
|