2025-04-30 15:59:19 +12:00
|
|
|
---
|
2025-05-07 10:33:23 +12:00
|
|
|
title: "atan"
|
2025-05-08 08:26:56 +12:00
|
|
|
subtitle: "Function in std::math"
|
2025-04-30 15:59:19 +12:00
|
|
|
excerpt: "Compute the arctangent of a number."
|
|
|
|
layout: manual
|
|
|
|
---
|
|
|
|
|
|
|
|
Compute the arctangent of a number.
|
|
|
|
|
2025-05-01 04:03:22 +12:00
|
|
|
```kcl
|
2025-05-02 03:56:27 +12:00
|
|
|
atan(@num: number(_)): number(rad)
|
2025-04-30 15:59:19 +12:00
|
|
|
```
|
|
|
|
|
2025-05-07 10:33:23 +12:00
|
|
|
Consider using `atan2()` instead for the true inverse of tangent.
|
|
|
|
|
2025-04-30 15:59:19 +12:00
|
|
|
### Arguments
|
|
|
|
|
|
|
|
| Name | Type | Description | Required |
|
|
|
|
|----------|------|-------------|----------|
|
|
|
|
| `num` | `number(_)` | | Yes |
|
|
|
|
|
|
|
|
### Returns
|
|
|
|
|
|
|
|
`number(rad)`
|
|
|
|
|
|
|
|
|
|
|
|
### Examples
|
|
|
|
|
2025-05-01 04:03:22 +12:00
|
|
|
```kcl
|
2025-04-30 15:59:19 +12:00
|
|
|
sketch001 = startSketchOn(XZ)
|
|
|
|
|> startProfile(at = [0, 0])
|
|
|
|
|> angledLine(
|
2025-04-30 11:07:05 -04:00
|
|
|
angle = atan(1.25),
|
2025-04-30 15:59:19 +12:00
|
|
|
length = 20,
|
|
|
|
)
|
|
|
|
|> yLine(endAbsolute = 0)
|
|
|
|
|> close()
|
|
|
|
|
|
|
|
extrude001 = extrude(sketch001, length = 5)
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|