49 lines
85 KiB
Markdown
49 lines
85 KiB
Markdown
---
|
|
title: "sin"
|
|
excerpt: "Compute the sine of a number (in radians)."
|
|
layout: manual
|
|
---
|
|
|
|
Compute the sine of a number (in radians).
|
|
|
|
|
|
|
|
```js
|
|
sin(num: number) -> number
|
|
```
|
|
|
|
### Tags
|
|
|
|
* `math`
|
|
|
|
|
|
### Arguments
|
|
|
|
| Name | Type | Description | Required |
|
|
|----------|------|-------------|----------|
|
|
| `num` | `number` | | Yes |
|
|
|
|
### Returns
|
|
|
|
`number`
|
|
|
|
|
|
### Examples
|
|
|
|
```js
|
|
exampleSketch = startSketchOn("XZ")
|
|
|> startProfileAt([0, 0], %)
|
|
|> angledLine({
|
|
angle = 50,
|
|
length = 15 / sin(toDegrees(135))
|
|
}, %)
|
|
|> yLineTo(0, %)
|
|
|> close()
|
|
|
|
example = extrude(exampleSketch, length = 5)
|
|
```
|
|
|
|

|
|
|
|
|