blob: 08e76b162c643212ac09bfb93e16d8275fa519af (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
%%
%% This is file `trig.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% trig.dtx (with options: `package')
%%
%% File: trig.dtx Copyright (C) 1993 1994 1995 1996 1997 1999 David Carlisle
%%
%% This file is part of the Standard LaTeX `Graphics Bundle'.
%% It may be distributed under the terms of the LaTeX Project Public
%% License, as described in lppl.txt in the base LaTeX distribution.
%% Either version 1.3c or, at your option, any later version.
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{trig}
[1999/03/16 v1.09 sin cos tan (DPC)]
\chardef\nin@ty=90
\chardef\@clxx=180
\chardef\@lxxi=71
\mathchardef\@mmmmlxviii=4068
\chardef\@coeffz=72
\chardef\@coefb=42
\mathchardef\@coefc=840
\mathchardef\@coefd=5040
{\catcode`t=12\catcode`p=12\gdef\noPT#1pt{#1}}
\def\TG@rem@pt#1{\expandafter\noPT\the#1\space}
\def\TG@term#1{%
\dimen@\@tempb\dimen@
\advance\dimen@ #1\p@}
\def\TG@series{%
\dimen@\@lxxi\dimen@
\divide \dimen@ \@mmmmlxviii
\edef\@tempa{\TG@rem@pt\dimen@}%
\dimen@\@tempa\dimen@
\edef\@tempb{\TG@rem@pt\dimen@}%
\divide\dimen@\@coeffz
\advance\dimen@\m@ne\p@
\TG@term\@coefb
\TG@term{-\@coefc}%
\TG@term\@coefd
\dimen@\@tempa\dimen@
\divide\dimen@ \@coefd}
\def\CalculateSin#1{{%
\expandafter\ifx\csname sin(\number#1)\endcsname\relax
\dimen@=#1\p@\TG@@sin
\expandafter\xdef\csname sin(\number#1)\endcsname
{\TG@rem@pt\dimen@}%
\fi}}
\def\CalculateCos#1{{%
\expandafter\ifx\csname cos(\number#1)\endcsname\relax
\dimen@=\nin@ty\p@
\advance\dimen@-#1\p@
\TG@@sin
\expandafter\xdef\csname cos(\number#1)\endcsname
{\TG@rem@pt\dimen@}%
\fi}}
\def\TG@reduce#1#2{%
\dimen@#1#2\nin@ty\p@
\advance\dimen@#2-\@clxx\p@
\dimen@-\dimen@
\TG@@sin}
\def\TG@@sin{%
\ifdim\TG@reduce>+%
\else\ifdim\TG@reduce<-%
\else\TG@series\fi\fi}%
\def\UseSin#1{\csname sin(\number#1)\endcsname}
\def\UseCos#1{\csname cos(\number#1)\endcsname}
\chardef\z@num\z@
\expandafter\let\csname sin(0)\endcsname\z@num
\expandafter\let\csname cos(0)\endcsname\@ne
\expandafter\let\csname sin(90)\endcsname\@ne
\expandafter\let\csname cos(90)\endcsname\z@num
\expandafter\let\csname sin(-90)\endcsname\m@ne
\expandafter\let\csname cos(-90)\endcsname\z@num
\expandafter\let\csname sin(180)\endcsname\z@num
\expandafter\let\csname cos(180)\endcsname\m@ne
\def\CalculateTan#1{{%
\expandafter\ifx\csname tan(\number#1)\endcsname\relax
\CalculateSin{#1}%
\CalculateCos{#1}%
\@tempdima\UseCos{#1}\p@
\divide\@tempdima\@iv
\@tempdimb\UseSin{#1}\p@
\@tempdimb\two@fourteen\@tempdimb
\divide\@tempdimb\@tempdima
\expandafter\xdef\csname tan(\number#1)\endcsname
{\TG@rem@pt\@tempdimb}%
\fi}}
\def\UseTan#1{\csname tan(\number#1)\endcsname}
\mathchardef\two@fourteen=16384
\chardef\@iv=4
\expandafter\def\csname tan(90)\endcsname{\errmessage{Infinite tan !}}
\expandafter\let\csname tan(-90)\expandafter\endcsname
\csname tan(90)\endcsname
\endinput
%%
%% End of file `trig.sty'.
|