| 1 |
%% |
| 2 |
%% This is file `trig.sty', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% trig.dtx (with options: `package') |
| 8 |
%% |
| 9 |
%% The source is maintained by the LaTeX Project team and bug |
| 10 |
%% reports for it can be opened at https://latex-project.org/bugs/ |
| 11 |
%% (but please observe conditions on bug reports sent to that address!) |
| 12 |
%% |
| 13 |
%% |
| 14 |
%% File: trig.dtx Copyright (C) 1993-1999 David Carlisle |
| 15 |
%% Copyright (C) 2000-2025 LaTeX Project |
| 16 |
%% The LaTeX Project and any individual authors listed elsewhere |
| 17 |
%% in this file. |
| 18 |
%% |
| 19 |
%% This file is part of the Standard LaTeX `Graphics Bundle'. |
| 20 |
%% It may be distributed under the terms of the LaTeX Project Public |
| 21 |
%% License, as described in lppl.txt in the base LaTeX distribution. |
| 22 |
%% Either version 1.3c or, at your option, any later version. |
| 23 |
%% |
| 24 |
\NeedsTeXFormat{LaTeX2e} |
| 25 |
\ProvidesPackage{trig} |
| 26 |
[2023/12/02 v1.11 sin cos tan (DPC)] |
| 27 |
\chardef\nin@ty=90 |
| 28 |
\chardef\@clxxx=180 |
| 29 |
\chardef\@lxxi=71 |
| 30 |
\mathchardef\@mmmmlxviii=4068 |
| 31 |
\chardef\@coeffz=72 |
| 32 |
\chardef\@coefb=42 |
| 33 |
\mathchardef\@coefc=840 |
| 34 |
\mathchardef\@coefd=5040 |
| 35 |
{\catcode`t=12\catcode`p=12\gdef\noPT#1pt{#1}} |
| 36 |
\def\TG@rem@pt#1{\expandafter\noPT\the#1\space} |
| 37 |
\def\TG@term#1{% |
| 38 |
\dimen@\@tempb\dimen@ |
| 39 |
\advance\dimen@ #1\p@} |
| 40 |
\def\TG@series{% |
| 41 |
\dimen@\@lxxi\dimen@ |
| 42 |
\divide \dimen@ \@mmmmlxviii |
| 43 |
\edef\@tempa{\TG@rem@pt\dimen@}% |
| 44 |
\dimen@\@tempa\dimen@ |
| 45 |
\edef\@tempb{\TG@rem@pt\dimen@}% |
| 46 |
\divide\dimen@\@coeffz |
| 47 |
\advance\dimen@\m@ne\p@ |
| 48 |
\TG@term\@coefb |
| 49 |
\TG@term{-\@coefc}% |
| 50 |
\TG@term\@coefd |
| 51 |
\dimen@\@tempa\dimen@ |
| 52 |
\divide\dimen@ \@coefd} |
| 53 |
\def\CalculateSin#1{{% |
| 54 |
\expandafter\ifx\csname sin(\number#1)\endcsname\relax |
| 55 |
\dimen@=#1\p@\TG@@sin |
| 56 |
\expandafter\xdef\csname sin(\number#1)\endcsname |
| 57 |
{\TG@rem@pt\dimen@}% |
| 58 |
\fi}} |
| 59 |
\def\CalculateCos#1{{% |
| 60 |
\expandafter\ifx\csname cos(\number#1)\endcsname\relax |
| 61 |
\dimen@=\nin@ty\p@ |
| 62 |
\advance\dimen@-#1\p@ |
| 63 |
\TG@@sin |
| 64 |
\expandafter\xdef\csname cos(\number#1)\endcsname |
| 65 |
{\TG@rem@pt\dimen@}% |
| 66 |
\fi}} |
| 67 |
\def\TG@reduce#1#2{% |
| 68 |
\dimen@#1#2\nin@ty\p@ |
| 69 |
\advance\dimen@#2-\@clxxx\p@ |
| 70 |
\dimen@-\dimen@ |
| 71 |
\TG@@sin} |
| 72 |
\def\TG@@sin{% |
| 73 |
\ifdim\TG@reduce>+% |
| 74 |
\else\ifdim\TG@reduce<-% |
| 75 |
\else\TG@series\fi\fi}% |
| 76 |
\def\UseSin#1{\csname sin(\number#1)\endcsname} |
| 77 |
\def\UseCos#1{\csname cos(\number#1)\endcsname} |
| 78 |
\def\z@num{0 } |
| 79 |
\def\@tempa{1 } |
| 80 |
\def\@tempb{-1 } |
| 81 |
\expandafter\let\csname sin(0)\endcsname\z@num |
| 82 |
\expandafter\let\csname cos(0)\endcsname\@tempa |
| 83 |
\expandafter\let\csname sin(90)\endcsname\@tempa |
| 84 |
\expandafter\let\csname cos(90)\endcsname\z@num |
| 85 |
\expandafter\let\csname sin(-90)\endcsname\@tempb |
| 86 |
\expandafter\let\csname cos(-90)\endcsname\z@num |
| 87 |
\expandafter\let\csname sin(180)\endcsname\z@num |
| 88 |
\expandafter\let\csname cos(180)\endcsname\@tempb |
| 89 |
\expandafter\let\csname sin(270)\endcsname\@tempb |
| 90 |
\expandafter\let\csname cos(270)\endcsname\z@num |
| 91 |
\expandafter\let\csname sin(360)\endcsname\z@num |
| 92 |
\expandafter\let\csname cos(360)\endcsname\@tempa |
| 93 |
\expandafter\let\csname sin(-180)\endcsname\z@num |
| 94 |
\expandafter\let\csname cos(-180)\endcsname\@tempb |
| 95 |
\expandafter\let\csname sin(-270)\endcsname\@tempa |
| 96 |
\expandafter\let\csname cos(-270)\endcsname\z@num |
| 97 |
\expandafter\let\csname sin(-360)\endcsname\z@num |
| 98 |
\expandafter\let\csname cos(-360)\endcsname\@tempa |
| 99 |
\def\CalculateTan#1{{% |
| 100 |
\expandafter\ifx\csname tan(\number#1)\endcsname\relax |
| 101 |
\CalculateSin{#1}% |
| 102 |
\CalculateCos{#1}% |
| 103 |
\@tempdima\UseCos{#1}\p@ |
| 104 |
\divide\@tempdima\@iv |
| 105 |
\@tempdimb\UseSin{#1}\p@ |
| 106 |
\@tempdimb\two@fourteen\@tempdimb |
| 107 |
\divide\@tempdimb\@tempdima |
| 108 |
\expandafter\xdef\csname tan(\number#1)\endcsname |
| 109 |
{\TG@rem@pt\@tempdimb}% |
| 110 |
\fi}} |
| 111 |
\def\UseTan#1{\csname tan(\number#1)\endcsname} |
| 112 |
\mathchardef\two@fourteen=16384 |
| 113 |
\chardef\@iv=4 |
| 114 |
\expandafter\def\csname tan(90)\endcsname{\errmessage{Infinite tan !}} |
| 115 |
\expandafter\let\csname tan(-90)\expandafter\endcsname |
| 116 |
\csname tan(90)\endcsname |
| 117 |
\endinput |
| 118 |
%% |
| 119 |
%% End of file `trig.sty'. |