LaTeX Creating a right triangle in Cartesian plane in LaTeX

AI Thread Summary
To create a right triangle in a Cartesian plane using LaTeX without grid lines, the TikZ package is recommended. The user can define the x- and y-axes with specific draw commands, followed by a command to draw the triangle itself. A sample code snippet is provided, illustrating how to structure the TikZ picture for this purpose. Additionally, the TikZ manual is suggested as a resource for further examples and refinements. This approach allows for clear and customizable geometric illustrations in LaTeX 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.
 

Similar threads

Replies
3
Views
3K
Replies
9
Views
2K
Replies
12
Views
3K
Replies
3
Views
3K
Replies
1
Views
2K
Replies
1
Views
1K
Back
Top