1

I need to draw three different triangles. I'm trying to use tkz-euclide, or any method which is at least readable, and easy to understand what happening.

Here's screenshots of the three triangles. I think I can legally post them here, they're only three triangles with no other data from the source - a textbook. triangles.

I've tried using tikz and tkz-euclide, but both documentations are hard to find explanations on some commands, and there is the big problem that it's a rotated triangle, no flat base, making learning the specifics for the code harder. However, tkz-euclide is preferable. Plus I have a deadline to finish this document, so I can't explore as deeply as I would like. I don't want to calculate the sides and angles then use the values, it may lead to imperfections.

Using the data I have, can I draw the triangles? I don't mind some trial-and-error.

1
2

You can also use IPE, it's an amazing tool, similar to Geogebra, but extremely compatible with LaTeX. Everything I do practically comes with IPE, in addition to the fact that it can also be merged with Tikz, so if there is something missing by IPE, you can complete by Tikz. Make the drawing you want and save it in .pdf, then just insert into the figure, anytime you want you can edit. I am sending a video demonstrating some figures that can be created by IPE (all vectorized). In addition, making figures using IPE is much faster than using Tikz. The difference is in the possibilities of what each one can do. But for simple designs the IPE is sensational. I'm sending some images I've made with IPE.

https://www.youtube.com/watch?v=pTGSvqP2j6o

enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here

4
  • 1
    +1 I like your this work! Your examples are beautiful and clean. – user213378 Jan 18 at 2:26
  • Thanks, @NguyenVanChi, I aprreciate :) , – João Coelho Jan 18 at 5:45
  • 1
    This is cool, I'm definitely going to try and use this more. Looks great and what's more, no giant wall of scary tikz – Harith Jan 18 at 11:40
  • +1 also to me...It is very nice. – Sebastiano Jan 21 at 13:07
1

Here is a small code to draw the first triangle with pstricks. The pst-eucl package defines commands to mimick constructions with ruler and compass (intersections line-line, line-circle, circle-circle, &c.):

 \documentclass[border=6pt, svgnames]{standalone}
 \usepackage{pst-eucl}%

\begin{document}
    \begin{pspicture}(-0.5,-0.5)(4,3.5)%
    \SpecialCoor
   \psset{PointSymbol=none, unit=3mm, linejoin=1}
   \pstGeonode[PosAngle={200,90,0},PointName={default,default,none,none}](0,0){C}(12;55){A}(20;55){A1}(25;15){I}
   \pstInterLC[PointNameA=]{C}{I}{A}{A1}{D}{B}
   \pspolygon(A)(B)(C)
   \psset{labelsep=2pt,nrot=:U }
   \pcline[linestyle=none](A)(B)\naput{8\,cm}
   \pcline[linestyle=none](C)(A)\naput{12\,cm}
   \psset{MarkAngleRadius=2, linecolor=IndianRed}
   \pstMarkAngle[LabelSep=2.6, MarkAngleRadius=3.8]{B}{C}{A}{$40^{\circ}$}
   \pstMarkAngle[LabelSep=1.4]{A}{B}{C}{$x$}
   \pstMarkAngle[LabelSep=1.4]{C}{A}{B}{$y$}
   \end{pspicture}

\end{document} 

enter image description here

2
  • This is the best replicated but it's gonna take me some time to learn l those commands. Nevertheless, thanks a lot for posting – Harith Jan 18 at 14:47
  • @HarithShah: All pstricks packages are well documented, with many examples, and their syntax is a latex syntax. To make the working flow easier and shorter, it is best to prepare figures as standalone files and compile with xelatex --shell-escape. – Bernard Jan 18 at 15:00
1

A mixed (Ti*K*z and tkz-euclide) solution. I think the code is self-explanatory.

\documentclass[margin=3mm]{standalone} 
\usepackage{tkz-euclide}
\usepackage{siunitx}
\begin{document}
\begin{tikzpicture}[
  my angle/.style={
    every pic quotes/.append style={text=cyan},
    draw=cyan
      }]
    \tkzDefPoint(0,0){C}  \tkzLabelPoint[below left](C){C}
    \tkzDefPoint(3,1){B}  \tkzLabelPoint[below right](B){B}
    \tkzDefPoint(1.5,3){A}  \tkzLabelPoint[above](A){A}
   
    \tkzDrawSegments(A,B B,C C,A)
    
    
    \pic [my angle, "$40^{\circ}$",angle radius=1.1cm] {angle=B--C--A};
    \pic [my angle, "$x$"] {angle=C--A--B};
    \pic [my angle, "$y$"] {angle=A--B--C};
    
    \draw (C) -- node[midway,above,sloped] {\SI{12}{\cm}}
      (A) -- node[midway,above,sloped] {\SI{8}{\cm}}(B);
   
\end{tikzpicture}
\end{document}

enter image description here

1
  • 1
    Yours is the simplest, I'll probably use that. But it uses guesses as to where the points are relative to eachother. – Harith Jan 18 at 11:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.