2

I want to make this table automaticly. That is mean, I receive the value of $\sin$, $\cos$, $\tan$ and $\cot$ of the angle $\alpha$ without typesetting by hand. But I don't know. enter image description here

How can I make it?

Note. The words "Không xác định" means undefined.

Andrew Swann
  • 95,762
minthao_2011
  • 4,534
  • 7
  • 36
  • 61

1 Answers1

3
\documentclass[border=3pt]{standalone}
\usepackage{booktabs}
\usepackage{array}
\usepackage{amsmath}

\setlength\extrarowheight{2pt}

\def\getNum#1\relax{\gdef\num{#1}$\tfrac{1}{2}\sqrt{#1}$}

\def\getDenum#1\\{\gdef\denum{#1}$\tfrac{1}{2}\sqrt{#1}$&$\sqrt{\tfrac{\num}{\denum}}$\\}

\begin{document}

\begin{tabular}
{
    >{$}c<{^\circ$}
    >{\getNum}c
    >{\getDenum}c
    c
}
\toprule
\multicolumn{1}{c}{$\theta$}&
    \multicolumn{1}{c}{$\sin\theta$}&
        \multicolumn{1}{c}{$\cos\theta$}&
            \multicolumn{1}{c}{$\tan\theta$}\\
\midrule
0&
    0&
        4\\
30&
    1&
        3\\
45&
    2&
        2\\
60&
    3&
        1\\
90&
    4&
        0\\
\bottomrule
\end{tabular}

\end{document}

enter image description here

Or you might be looking for this question: How to generate a table of trigonometric functions that can be broken across pages?.

Moriambar
  • 11,466