49 lines
80 KiB
Markdown
49 lines
80 KiB
Markdown
---
|
|
title: "toRadians"
|
|
excerpt: "Converts a number from degrees to radians."
|
|
layout: manual
|
|
---
|
|
|
|
Converts a number from degrees to radians.
|
|
|
|
|
|
|
|
```js
|
|
toRadians(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(toRadians(45))
|
|
}, %)
|
|
|> yLineTo(0, %)
|
|
|> close(%)
|
|
|
|
example = extrude(5, exampleSketch)
|
|
```
|
|
|
|

|
|
|
|
|