Jumat, 15 November 2024

The Pythagorean Theorem In Latex

  1. Type this following latex code in the latex editor:
    % !TEX TS-program=pdflatex
    % !TEX encoding=UTF-8 Unicode
    %
    % File name: triangleTheorem1.tex
    % Description:
    % The Pythagorean Theorem
    %
    % Composer: private course and tutor course
    \documentclass[12pt,a4paper]{report}
    \usepackage{tikz}
    \usepackage{amsmath}
    \usepackage{bm}
    \usepackage[active,tightpage]{preview}
    \PreviewEnvironment{tikzpicture}
    \setlength\PreviewBorder{0.25pt}

    \begin{document}
    \begin{tikzpicture}[scale=3.5,thick]
    % Label the nodes and position
     \coordinate[label=below left:$\textbf{A}$] (A) at (0,0);
     \coordinate[label=below right:$\textbf{B}$] (B) at (1.5,0);
     \coordinate[label=above:$\textbf{C}$] (C) at (1.5,1);
     % Draw the triangle
     \draw (B) -- (A) -- (C) -- cycle;
     % Label the sides
     \node[above] at (0.75,0) {$\textbf{c}$};
     \node[below] at (0.75,0) {\textbf{Adjacent}};
     \node[right] at (1.5,0.5) {\textbf{Opposite}};
     \node[left] at (1.5,0.5) {$\textbf{a}$};
     % Label the angle
     \draw (0.4,0) arc (0:33.69:0.4) node[right,midway] {$\boldsymbol{\theta}$};
     \node[above left] at (0.75,0.5) {\textbf{Hypotenuse}};
     \node[below right] at (0.75,0.5) {$\textbf{b}$};
     % Draw the right angle mark
     \draw (1.30,0) -- (1.30,.2) -- (1.50,0.2);
    \end{tikzpicture}
    \end{document}

  2. Save file as triangleTheorem1.tex
  3. Then build or typeset the Latex code.

Output



<< to learn other two dimensional shape, click Two Dimensional Shape 3

to learn Pythagorean Theorem, click The Pythagorean Theorem >

Related Post

Tidak ada komentar:

Posting Komentar

Various Other Posts