math::trig(n)

πŸ“¦
version 2.0 Β· 2 versions
, in fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

πŸ¦‹ math::trig(n) πŸ¦‹

okay bestie, welcome to the math::trig page β€” manual section n, straight out of the Tcl Math Library. it's giving trigonometry, it's giving hyperbolics, it's giving inverses, it's giving degrees AND radians, and honestly? she ate. periodt. πŸ’…βœ¨


πŸŽ€ NAME πŸŽ€

math::trig β€” Trigonometric anf hyperbolic functions

ngl, that "anf" is literally what the original says. we preserve. we do not fix. πŸ’€ (love that for her tho)

🌸 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 ✨

so the math::trig package defines a whole set of trigonomic and hyperbolic functions and their inverses. not only that β€” she ALSO defines versions of the trigonomic functions that take their arguments in degrees instead of radians. versatile queen. πŸ‘‘

and for easy use? these functions may be imported into the tcl::mathfunc namespace, so that they can be used directly in the expr command. iykyk. 🫢


πŸ”₯ FUNCTIONS πŸ”₯

okay so first up: radian_reduced and degree_reduced return a reduced angle β€” in radians and degrees respectively β€” inside 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 girlies

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

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

🌈 degree mode, bestie

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)
bestie i am OBSESSED with the fact that cosd says its angle is in radians and tand says it computes the cotangent. i did not write those. the original did. i am simply the messenger and i respect the source material. πŸ’€ copy-paste fidelity is the whole assignment. πŸ™ˆ

😭 BUGS, IDEAS, FEEDBACK 😭

This document, and the package it describes, will undoubtedly contain bugs and other problems. not me being dramatic β€” that's literally the sentence. Please report such in the category math :: trig of the Tcllib Trackers http://core.tcl.tk/tcllib/reportlist.

Please also report any ideas for enhancements you may have for either package and/or documentation. she wants ur thoughts. she's listening. 🫢

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

heads up fr fr: 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. that's the whole ritual. slay. πŸ’…

⭐ KEYWORDS ⭐

math, trigonometry


πŸ‘‘ CATEGORY πŸ‘‘

Mathematics


Copyright (c) 2018 Arjen Markus


aaaand that's the page, bestie!! πŸŽ€ this one shipped in tcllib, version 1.1, under the name math::trig(n) β€” so if u ever forget where u are, that's the vibe check. go reduce an angle. go find a cosecant. go be the main character of ur own expr. πŸ¦‹βœ¨πŸ’œ

πŸ“¦ where this page comes from