KCL stdlib: Add atan2 function (#4771)

At Lee's request
This commit is contained in:
Adam Chalmers
2024-12-12 12:11:07 -06:00
committed by GitHub
parent 191b9b71fd
commit da05c38b9e
7 changed files with 137 additions and 0 deletions

49
docs/kcl/atan2.md Normal file

File diff suppressed because one or more lines are too long

View File

@ -30,6 +30,7 @@ layout: manual
* [`assertLessThan`](kcl/assertLessThan)
* [`assertLessThanOrEq`](kcl/assertLessThanOrEq)
* [`atan`](kcl/atan)
* [`atan2`](kcl/atan2)
* [`bezierCurve`](kcl/bezierCurve)
* [`ceil`](kcl/ceil)
* [`chamfer`](kcl/chamfer)

View File

@ -43523,6 +43523,58 @@
"sketch001 = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> angledLine({\n angle = toDegrees(atan(1.25)),\n length = 20\n }, %)\n |> yLineTo(0, %)\n |> close(%)\n\nextrude001 = extrude(5, sketch001)"
]
},
{
"name": "atan2",
"summary": "Compute the four quadrant arctangent of Y and X (in radians).",
"description": "",
"tags": [
"math"
],
"keywordArguments": false,
"args": [
{
"name": "y",
"type": "number",
"schema": {
"$schema": "https://spec.openapis.org/oas/3.0/schema/2019-04-02#/definitions/Schema",
"title": "double",
"type": "number",
"format": "double"
},
"required": true,
"labelRequired": true
},
{
"name": "x",
"type": "number",
"schema": {
"$schema": "https://spec.openapis.org/oas/3.0/schema/2019-04-02#/definitions/Schema",
"title": "double",
"type": "number",
"format": "double"
},
"required": true,
"labelRequired": true
}
],
"returnValue": {
"name": "",
"type": "number",
"schema": {
"$schema": "https://spec.openapis.org/oas/3.0/schema/2019-04-02#/definitions/Schema",
"title": "double",
"type": "number",
"format": "double"
},
"required": true,
"labelRequired": true
},
"unpublished": false,
"deprecated": false,
"examples": [
"sketch001 = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> angledLine({\n angle = toDegrees(atan2(1.25, 2)),\n length = 20\n }, %)\n |> yLineTo(0, %)\n |> close(%)\n\nextrude001 = extrude(5, sketch001)"
]
},
{
"name": "bezierCurve",
"summary": "Draw a smooth, continuous, curved line segment from the current origin to",