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
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 3K views
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.
 
Reply
  • Informative
Likes   Reactions: berkeman