Files
modeling-app/docs/kcl-std/functions/std-units-toDegrees.md
Nick Cameron 2b509a515b More docs for Plane, Pi, etc. (#6850)
* Document the units of PI

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Add links between lang and std references

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Change signature of conversion functions

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Split foreign imports out of modules docs

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* More docs for Plane

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Update docs/kcl-std/consts/std-math-PI.md

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

* Update rust/kcl-lib/std/math.kcl

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-05-12 12:59:45 +12:00

84 KiB

title, subtitle, excerpt, layout
title subtitle excerpt layout
units::toDegrees Function in std::units Converts a number to degrees from its current units. manual

Converts a number to degrees from its current units.

units::toDegrees(@num: number(Angle)): number(deg)

Arguments

Name Type Description Required
num number(Angle) A number. Yes

Returns

number(deg) - A number.

Examples

exampleSketch = startSketchOn(XZ)
  |> startProfile(at = [0, 0])
  |> angledLine(
    angle = 50,
    length = 70 * cos(units::toDegrees((PI/4): number(rad))),
  )
  |> yLine(endAbsolute = 0)
  |> close()

example = extrude(exampleSketch, length = 5)

Rendered example of units::toDegrees 0