Creating a right triangle in Cartesian plane in LaTeX

  • Context: LaTeX 
  • Thread starter Thread starter cbarker1
  • Start date Start date
  • Tags Tags
    Latex Right triangle
Click For Summary
SUMMARY

This discussion focuses on creating a right triangle in the Cartesian plane using LaTeX with the TikZ package. The user, cbarker1, seeks to generate a diagram without grid lines, specifically requesting assistance with the TikZ syntax. A solution is provided, demonstrating the necessary commands to draw the x- and y-axes along with the triangle itself. The TikZ manual is recommended as a resource for further refinement and examples.

PREREQUISITES
  • Basic understanding of LaTeX document preparation
  • Familiarity with TikZ package for creating graphics
  • Knowledge of Cartesian coordinate system
  • Ability to interpret LaTeX syntax and commands
NEXT STEPS
  • Explore TikZ documentation for advanced drawing techniques
  • Learn about TikZ styles and customization options
  • Investigate LaTeX packages for additional geometric shapes
  • Practice creating complex diagrams using TikZ
USEFUL FOR

This discussion is beneficial for LaTeX users, graphic designers, and educators looking to create precise geometric illustrations in their documents.

cbarker1
Gold Member
MHB
Messages
345
Reaction score
23
Dear everybody,

I am trying to create a right triangle in Cartesian plane with no grid lines in Latex. I have no way to start it. I am having a hard time. I want to use tikz picture.

Thanks,
cbarker1
 
Last edited:
Physics news on Phys.org
By "Cartesian plane with no grid lines", do you mean you want to show the x- and y-axes?

If so, try this:

Code:
\begin{tikzpicture}
            \draw[<->, line width=1pt] (-1.22,0) -- (3.22,0) node[right] {$x$};
            \draw[<->, line width=1pt] (0,-1.22) -- (0,4.22) node[above] {$y$};
            \draw (1,1) -- (2,1) -- (1,3) -- cycle;
\end{tikzpicture}

The first two draw commands draw the x- and y-axes, respectively, and the final draw command draws the right triangle.

The manual for TikZ is linked to from its CTAN page. You can find good examples there to help you refine your diagram.
 
  • Informative
Likes   Reactions: berkeman

Similar threads

  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K