49 lines
86 KiB
Markdown
49 lines
86 KiB
Markdown
---
|
|
title: "toDegrees"
|
|
excerpt: "Converts a number from radians to degrees."
|
|
layout: manual
|
|
---
|
|
|
|
Converts a number from radians to degrees.
|
|
|
|
|
|
|
|
```js
|
|
toDegrees(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 = 70 * cos(toDegrees(pi() / 4))
|
|
}, %)
|
|
|> yLineTo(0, %)
|
|
|> close()
|
|
|
|
example = extrude(exampleSketch, length = 5)
|
|
```
|
|
|
|

|
|
|
|
|