math::trig(n)
π¦ 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 valuefloat valueβ Value of the argument
::math::trig::asec valueβ Calculate the arc secant of the valuefloat valueβ Value of the argument
::math::trig::acotan valueβ Calculate the arc cotangent of the valuefloat 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 valuefloat valueβ Value of the argument
::math::trig::acosh valueβ Calculate the arc hyperbolic cosine of the valuefloat valueβ Value of the argument
::math::trig::atanh valueβ Calculate the arc hyperbolic tangent of the valuefloat valueβ Value of the argument
::math::trig::acosech valueβ Calculate the arc hyperbolic cosecant of the valuefloat valueβ Value of the argument
::math::trig::asech valueβ Calculate the arc hyperbolic secant of the valuefloat valueβ Value of the argument
::math::trig::acotanh valueβ Calculate the arc hyperbolic cotangent of the valuefloat 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 thatcosdsays its angle is in radians andtandsays 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 π
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
- fedora 43: tcllib 2.0-3.fc43 Β· TCL
- fedora 44: tcllib 2.0-4.fc44 Β· TCL
- nixos 26.05: tcllib 2.0
- nixpkgs unstable: tcllib 2.0
- Copyright (c) 2018 Arjen Markus
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms