[Tex/LaTex] How to make right angle mark in geometry 3D like this picture


I want to mark right angle. I tried in Geogebra

\psset{xunit=1.0cm,yunit=1.0cm,algebraic=true,dotstyle=*,dotsize=3pt 0,linewidth=0.8pt,arrowsize=3pt 2,arrowinset=0.25}

enter image description here
How can I draw with anorher way?

Best Answer

This is one possible solution via tikz-3dplot. Here numbers are used for labeling for ease of programming. Explanatory comments are added in the code. The right angles on the xy plane are found via intersections of grid lines notion, that is, finding intersection points of parellel lines that are parallel to d5-d6 and d7-d8. enter image description here


\begin{tikzpicture}[scale=2, tdplot_main_coords,axis/.style={->,dashed},thick]
% -- remove these 3 lines if no axis is preferred
\draw[axis] (-2, 0, 0) -- (5, 0, 0) node [right] {$X$};
\draw[axis] (0, 0, 0) -- (0, 5, 0) node [above] {$Y$};
\draw[axis] (0, 0, 0) -- (0, 0, 2) node [above] {$Z$};
% define points
\coordinate  (d1) at (0,0,0){};
\coordinate  (d2) at (4,0,0){};
\coordinate  (d3) at (4,4,0){};
\coordinate  (d4) at (0,4,0){};
\coordinate  (d5) at (3,2,0){};
\coordinate  (d6) at (1,3,0){};
\coordinate  (d7) at ($(d5)!0.7!(d6)$){};
\coordinate  (d8) at (1,1,0){}; 
\coordinate  (d9) at (1,1,2){}; 
\path  (d7) -- ($(d7)!-2cm!(d8)$) coordinate(e1);    % find the extended point e1
\path  (d5) -- ($(d5)! 3cm!(d6)$) coordinate(e2);    % find the extended point e2
% connect lines
\draw [] (d1)--(d2)--(d3)--(d4) -- (d1);                         
\draw [name path=line4] (d5) --(d6);
\draw [] (d7) --(d8) -- (d9)-- (d7);
\coordinate (a) at ($(d8)!0.2!(d7)$);                % find point a on the  line d8-d7
% draw vertical lines of length 0.3cm and form a right angle on z plane
\draw [red] (d8)  ++(0,0,0.3) -- ($(a)+(0,0,0.3)$)--(a);     
% auxiliary lines to find right corners via drawing parallel/grid lines
\path [name path=line1] ([xshift= 0.5cm]d8) -- ([xshift= 0.5cm]d7);
\path [name path=line2] ([xshift=-0.5cm]d8) -- ([xshift=-0.5cm]e1);
\path [name path=line3] ([xshift=-1cm]d5) -- ([xshift=-1cm]e2);
% find intersections corners
\path [name intersections={of=line1 and line3, by={D1}}];
\path [name intersections={of=line1 and line4, by={D2}}];
\path [name intersections={of=line2 and line3,by={E1}}];
\path [draw,name intersections={of=line2 and line4, by={E2}}];
\draw [red]  (D1) -- (D2)   (E1) -- (E2)  (E1) -- (D1);
% --- labels for vertices
\foreach \i in {1,2,...,9}
\draw[fill=black] (d\i) circle (0.1em) node[above left] {\i};
\draw (d2) -- ++(0,0.5,0) arc (90:150:1)node[below]{\Large $\beta$};

Related Question