Files
modeling-app/docs/kcl-std/functions/std-math-cos.md
Jonathan Tran 851ea28bd3 Change trig functions to return number with Default units (#7425)
* Change trig functions to return number with Default units

* Update docs

* Update output
2025-06-11 00:24:48 +00:00

91 KiB

title, subtitle, excerpt, layout
title subtitle excerpt layout
cos Function in std::math Compute the cosine of a number. manual

Compute the cosine of a number.

cos(@num: number(Angle)): number

Arguments

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

Returns

number - A number.

Examples

exampleSketch = startSketchOn(XZ)
  |> startProfile(at = [0, 0])
  |> angledLine(angle = 30, length = 3 / cos(30deg))
  |> yLine(endAbsolute = 0)
  |> close()

example = extrude(exampleSketch, length = 5)

Rendered example of cos 0