Math & Science ⇒ Text on Side of a Triangle
-
- Posts: 7
- Joined: Wed Mar 24, 2010 4:10 am
Text on Side of a Triangle
\documentclass[12pt]{amsart}
\usepackage{fullpage}
\usepackage{amsmath,tikz,fullpage,amsthm}
\usepackage{amssymb}
\begin{document}
\begin{tikzpicture}[bullet/.style={coordinate,after node path=
{(\tikzlastnode) node {$\scriptstyle \bullet$}}}, scale = 2]
\draw [densely dotted,black] (0,0) circle (1cm);
\draw [semithick,black] (-.87,-.5) -- (-.45,.9) -- (.87,-.5) -- cycle;
\coordinate[label=above:$A$] (A) at (-1.02,-.66);
\coordinate[label=above:$C$] (C) at (-.45,.92);
\coordinate[label=above:$B$] (B) at (1.00,-.66);
\end{tikzpicture}
\end{document}
I need help drawing the three altitudes (lines from vertices) and being able to add cos(x) to the sides of the triangle it does in the picture. I need help the most on what I underlined. I am not very knowledgeable in tikz. I just know the very very basics. The labeling of the vertices I googled. Or does anyone know of any program that I could make that circle appear that way and then it would convert it to Tikz/Latex ?
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Text on Side of a Triangle
Code: Select all
\documentclass[12pt]{amsart}
\usepackage{fullpage}
\usepackage{amsmath,tikz,fullpage,amsthm}
\usepackage{amssymb}
\usetikzlibrary{calc,intersections}
\begin{document}
\begin{tikzpicture}[bullet/.style={coordinate,after node path={(\tikzlastnode) node {$\scriptstyle \bullet$}}}, scale = 2]
\draw [densely dotted,black] (0,0) circle (1cm);
\coordinate[label=below left:$A$] (A) at (-.87,-.5);
\coordinate[label=below right:$B$] (B) at (.87,-.5);
\coordinate[label=above:$C$] (C) at (-.45,.9);
\draw [semithick,black] (A) -- (B) -- (C) -- cycle;
\path[name path=alta] (A) -- ($(B)!(A)!(C)$);
\path[name path=altb] (B) -- ($(A)!(B)!(C)$);
\draw[name intersections={of=alta and altb,by=x}] (A) -- (x) node[fill=white,pos=0.6,inner xsep=0pt,inner ysep=1.5pt,right=-7pt] {\small $\cos \alpha$};
\draw (B) -- (x) node[fill=white,pos=0.5,inner xsep=0.5pt] {\small $\cos \beta$};
\draw (C) -- (x) node[fill=white,pos=0.7,inner xsep=0pt,right=-7pt] {\small $\cos \gamma$};
\end{tikzpicture}
\end{document}
Code: Select all
\path[name path=altc] (C) -- ($(A)!(C)!(B)$);

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Text on Side of a Triangle
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 7
- Joined: Wed Mar 24, 2010 4:10 am
Re: Text on Side of a Triangle
"c:\program files\miktex 2.7\tex\generic\pgf\modules\pgfmodulematrix.code.tex(5): Error: ! I can't find file `tikzlibraryintersections.code.tex'.
"c:\program files\miktex 2.7\tex\generic\pgf\modules\pgfmodulematrix.code.tex(5): Error: ! Emergency stop.
"c:\program files\miktex 2.7\tex\generic\pgf\modules\pgfmodulematrix.code.tex(1): Error: ! ==> Fatal error occurred, no output PDF file produced!
I found the file "tikzlibraryintersections.code.tex" online and downloaded it but I have no clue how to install this library. How do I get my editor to accept the intersections library?
Edit: Also how would I install a package? Say tkz-2d.sty?
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Text on Side of a Triangle
The current version also has a minimal support of intersections which is described in the manual (Section 12.2.4 - Intersection Coordinate Systems, p. 109ff).
[1] TikZ and PGF builds
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 7
- Joined: Wed Mar 24, 2010 4:10 am
Re: Text on Side of a Triangle
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Text on Side of a Triangle
Code: Select all
\documentclass{minimal}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=2]
\draw[densely dotted] (0,0) circle (1cm);
\coordinate[label=below left:$A$] (A) at (215:1cm);
\coordinate[label=below right:$B$] (B) at (325:1cm);
\coordinate[label=above:$C$] (C) at (110:1cm);
\draw[semithick] (A) -- (B) -- (C) -- cycle;
\end{tikzpicture}
\end{document}
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 7
- Joined: Wed Mar 24, 2010 4:10 am
Re: Text on Side of a Triangle
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Text on Side of a Triangle
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Text on Side of a Triangle
- Attachments
-
- cosTriangle.png (5.7 KiB) Viewed 7994 times