math::trig(3tcl)

πŸ“¦
version 2.0 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ NAME ✨

math::trig β€” Trigonometric anf hyperbolic functions πŸ¦‹

(yes bestie, "anf" is literally how it's printed up top β€” we're keeping it, it's canon, don't @ me πŸ’…)


πŸŽ€ SYNOPSIS πŸŽ€

package require Tcl 8.5 9

package require math::trig 1.1

::math::trig::radian_reduced angle

::math::trig::degree_reduced angle

::math::trig::cosec angle

::math::trig::sec angle

::math::trig::cotan angle

::math::trig::acosec value

::math::trig::asec value

::math::trig::acotan value

::math::trig::cosech value

::math::trig::sech value

::math::trig::cotanh value

::math::trig::asinh value

::math::trig::acosh value

::math::trig::atanh value

::math::trig::acosech value

::math::trig::asech value

::math::trig::acotanh value

::math::trig::sind angle

::math::trig::cosd angle

::math::trig::tand angle

::math::trig::cosecd angle

::math::trig::secd angle

::math::trig::cotand angle

πŸ’– DESCRIPTION πŸ’–

okay so math::trig is that girl: it hands you a whole squad of trigonomic and hyperbolic functions plus all their inverses, no cap. 🫢

And because sometimes you're out here living that degree life instead of radians, it also defines versions of the trigonomic functions that take their arguments in degrees instead of radians. slay.

Now the cute part: for easy use, these functions may be imported into the tcl::mathfunc namespace, so you can use them directly inside the expr command. it's giving convenience, it's giving main character energy. ✨


🌈 FUNCTIONS 🌈

πŸ” the reduced-angle girlies

radian_reduced and degree_reduced return a reduced angle β€” in radians and degrees respectively β€” sitting all cozy in the intervals [0, 2pi) and [0, 360). πŸ’«

::math::trig::radian_reduced angle

Return the equivalent angle in the interval [0, 2pi).

  • float angle β€” Angle (in radians)

::math::trig::degree_reduced angle

Return the equivalent angle in the interval [0, 360).

  • float angle β€” Angle (in degrees)

πŸ“ the extra trigonomic besties

The following trigonomic functions are defined in addition to the ones defined in the expr command:

::math::trig::cosec angle

Calculate the cosecant of the angle (1/cos(angle))

  • float angle β€” Angle (in radians)

::math::trig::sec angle

Calculate the secant of the angle (1/sin(angle))

  • float angle β€” Angle (in radians)

::math::trig::cotan angle

Calculate the cotangent of the angle (1/tan(angle))

  • float angle β€” Angle (in radians)

πŸ™ƒ and their inverses, obviously

For these functions also the inverses are defined:

::math::trig::acosec value

Calculate the arc cosecant of the value

  • float value β€” Value of the argument

::math::trig::asec value

Calculate the arc secant of the value

  • float value β€” Value of the argument

::math::trig::acotan value

Calculate the arc cotangent of the value

  • float value β€” Value of the argument

🧚 hyperbolic era

The following hyperbolic and inverse hyperbolic functions are defined:

::math::trig::cosech value

Calculate the hyperbolic cosecant of the value (1/sinh(value))

  • float value β€” Value of the argument

::math::trig::sech value

Calculate the hyperbolic secant of the value (1/cosh(value))

  • float value β€” Value of the argument

::math::trig::cotanh value

Calculate the hyperbolic cotangent of the value (1/tanh(value))

  • float value β€” Value of the argument

::math::trig::asinh value

Calculate the arc hyperbolic sine of the value

  • float value β€” Value of the argument

::math::trig::acosh value

Calculate the arc hyperbolic cosine of the value

  • float value β€” Value of the argument

::math::trig::atanh value

Calculate the arc hyperbolic tangent of the value

  • float value β€” Value of the argument

::math::trig::acosech value

Calculate the arc hyperbolic cosecant of the value

  • float value β€” Value of the argument

::math::trig::asech value

Calculate the arc hyperbolic secant of the value

  • float value β€” Value of the argument

::math::trig::acotanh value

Calculate the arc hyperbolic cotangent of the value

  • float value β€” Value of the argument

🌸 degrees, for the girls who don't do radians

The following versions of the common trigonometric functions and their inverses are defined:

::math::trig::sind angle

Calculate the sine of the angle (in degrees)

  • float angle β€” Angle (in degrees)

::math::trig::cosd angle

Calculate the cosine of the angle (in degrees)

  • float angle β€” Angle (in radians)

::math::trig::tand angle

Calculate the cotangent of the angle (in degrees)

  • float angle β€” Angle (in degrees)

::math::trig::cosecd angle

Calculate the cosecant of the angle (in degrees)

  • float angle β€” Angle (in degrees)

::math::trig::secd angle

Calculate the secant of the angle (in degrees)

  • float angle β€” Angle (in degrees)

::math::trig::cotand angle

Calculate the cotangent of the angle (in degrees)

  • float angle β€” Angle (in degrees)

πŸ› BUGS, IDEAS, FEEDBACK πŸ›

ngl bestie, this document β€” and the package it describes β€” will undoubtedly contain bugs and other problems. 😭 Please report such in the category math :: trig of the Tcllib Trackers (http://core.tcl.tk/tcllib/reportlist). And please also report any ideas for enhancements you may have for either package and/or documentation, we want them fr fr. 🫢

When proposing code changes, please provide unified diffs, i.e the output of diff -u.

Note further that attachments are strongly preferred over inlined patches. Attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. iykyk πŸ’…


πŸ”‘ KEYWORDS πŸ”‘

math, trigonometry


πŸ‘‘ CATEGORY πŸ‘‘

Mathematics


Copyright (c) 2018 Arjen Markus


and that's the whole vibe check πŸ’– this page came to you straight out of tcllib, version 1.1, and it's the math::trig(3tcl) manual β€” go forth and compute, you gorgeous nerd 🌈⭐🧚

πŸ“¦ where this page comes from