标记直角(结构分析)

标记直角(结构分析)

我正在尝试绘制这幅图:

在此处输入图片描述

到目前为止,在structuralanalysis包的帮助下我有了这个:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{calc}
\usepackage{structuralanalysis}

\begin{document}
 \begin{tikzpicture}[>=triangle 45]
  \draw[thick, ->] (-{sqrt(8)},-{sqrt(8)}) arc (225:-45:4cm)node[below right] {$L$};
  \draw[thick,->] (0,0) -- (2.79,2.79);
   \draw[color=black] (1.75,1.2) node[left] {$R$};
   \draw[thick,->] (3,3) -- (4,4.5);
   \draw[color=black] (3.9,4.4) node[above] {$\varphi$};
   \draw[color=black] (4.7,2) node[above] {$w$};
   \draw[thick,->] (3,3) -- (4.5,2);
   \draw[thick, ->] (4,3.5) arc (-90:180:1cm)node[below] {$\psi$};
   \point{a}{-{sqrt(8)}}{-{sqrt(8)}};
   \support{3}{a}[45];
 \end{tikzpicture}
 \end{document}

在此处输入图片描述

我的问题是如何绘制原始图形的直角标记?我会使用手动计算的四个点(例如 A、B、C、D)绘制每个正方形,然后

  \draw A--B--C--D--A; 

但我认为一定有一条更短的路。

答案1

如同在两条垂直线的交点处插入垂直符号但使用pic。语法类似于angle库的语法(可用于以各种样式注释任意度数的角度)。

我还调整了你的代码并使用

  • 极坐标(<angle>:<radius>)
  • 命名坐标,以及
  • 沿路径自动放置节点和坐标。

代码

\documentclass[tikz]{standalone}
\usetikzlibrary{arrows.meta,angles,calc}
\usepackage{structuralanalysis}
\tikzset{
  angleR distance/.initial=.3cm,
  pics/angleR/.style args={#1--#2--#3}{% This asumes a right angle between #2, #1 and #3
    setup code={%
      % This is the same as
      % … let \p0=($(#2.center)-(#1.center)$),
      % \n0=(atan2(\y0,\x0) in …
      % and storing \n0 in \tikzAngleRotate (or using it directly)
      \pgfmathanglebetweenpoints
        {\pgfpointanchor{#1}{center}}{\pgfpointanchor{#2}{center}}%
      \let\tikzAngleRotate\pgfmathresult},
    foreground code={
      \path[pic actions, rotate=\tikzAngleRotate]
           ($(#2)!\pgfkeysvalueof{/tikz/angleR distance}!(#1)$)
        |- ($(#2)!\pgfkeysvalueof{/tikz/angleR distance}!(#3)$);}
  }
}
\begin{document}
\begin{tikzpicture}[>=Triangle, auto=right, thick]
 \draw[->] (225:4) arc [start angle=225, end angle=-45, radius=4]
   coordinate[at start] (arc-start)
   node[at start, left] {$O$}
   node[below right] {$L$} coordinate[pos=2/3] (arc-tr);
 \draw[->, shorten >=\pgflinewidth] (0,0) -- node {$R$} (arc-tr);

 \coordinate (arc-tr') at ([shift=(45:.2cm)]arc-tr);
 \coordinate (O) at (0,0)
  coordinate (arc-start-e) at ([shift=(90+45:3)]arc-start);
 \draw[<->, shift=(arc-tr'), inner sep=.1667em] (45-90:1.5cm) coordinate (arc-tr'-A)
    -- node[at start] {$w$}       (0,0)                       coordinate (arc-tr'-B)
    -- node[at end]   {$\varphi$} (45:1.5cm)                  coordinate (arc-tr'-C);
 \draw[shift=(arc-tr'-C), ->] (-90:1cm)
   arc[start angle=-90, end angle=180, radius=1cm] node[left] {$\psi$};

 \support{3}{arc-start}[45];
 \pic[draw, thin] {angleR=arc-tr'-A--arc-tr'-B--arc-tr'-C};
 \pic[draw, thin, angleR distance=.15cm] {angleR=O--arc-start--arc-start-e};
\end{tikzpicture}
\end{document}

输出

在此处输入图片描述

答案2

我将解释其中一个直角标记。首先绘制两个坐标

\coordinate (O) at (0,0);
\coordinate (A) at (-{sqrt(8)},-{sqrt(8)});

然后画一条5mm长度与路径成直角的路径,OA例如

\path (A) -- ($(A)!5mm!90:(O)$)coordinate (A1);

将此路径的末端称为A1。现在以类似的方式绘制一条路径,但角度为 45 度,OA就像

\path (A) -- ($(A)!2mm!45:(O)$)coordinate (A2);

并且具有0如下角度

\path (A) -- ($(A)!5mm!(O)$)coordinate (A3);

A2然后在路径上绘制投影AA1

\draw (A2) -- ($(A)!(A2)!(A1)$);

A2以及在路径上的投影AA3

\draw (A2) -- ($(A)!(A2)!(O)$);

对于另一个,请遵循相同的步骤。

代码:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{calc}
\usepackage{structuralanalysis}

\begin{document}
 \begin{tikzpicture}[>=triangle 45]
  \draw[thick, ->] (-{sqrt(8)},-{sqrt(8)}) arc (225:-45:4cm)node[below right] {$L$};
  \draw[thick,->] (0,0) -- (2.79,2.79);
   \draw[color=black] (1.75,1.2) node[left] {$R$};
   \draw[thick,->] (3,3) -- +(45:2cm) coordinate (AA);
   \draw[color=black] (3.9,4.4) node[above] {$\varphi$};
   \draw[color=black] (4.7,2) node[above] {$w$};
   \draw[thick,->] (3,3) -- +(-45:2cm) coordinate (BB);
   \draw[thick, ->] (3,3)+(1,0.1) arc (-90:180:1cm)node[below] {$\psi$};
   \point{a}{-{sqrt(8)}}{-{sqrt(8)}};
   \support{3}{a}[45];

   \coordinate (O) at (0,0);
   \coordinate (A) at (-{sqrt(8)},-{sqrt(8)});
   \path (A) -- ($(A)!5mm!90:(O)$)coordinate (A1);
   \path (A) -- ($(A)!2mm!45:(O)$)coordinate (A2);
   \path (A) -- ($(A)!5mm!(O)$)coordinate (A3);
   \draw (A2) -- ($(A)!(A2)!(A1)$);
   \draw (A2) -- ($(A)!(A2)!(O)$);

   \coordinate (OO) at (3,3);
   \path (3,3) -- +(0:4mm) coordinate (AB);   
   \draw (AB) -- ($(AA)!(AB)!(OO)$);
   \draw (AB) -- ($(BB)!(AB)!(OO)$);


 \end{tikzpicture}
 \end{document}

在此处输入图片描述


tkz-euclid

\documentclass{standalone}
\usepackage{tkz-euclide}                 %% Add this
\usetkzobj{all}                          %% Add this
\usetikzlibrary{arrows}
\usetikzlibrary{calc}
\usepackage{structuralanalysis}

\begin{document}
 \begin{tikzpicture}[>=triangle 45]
  \draw[thick, ->] (-{sqrt(8)},-{sqrt(8)}) arc (225:-45:4cm)node[below right] {$L$};
  \draw[thick,->] (0,0) -- (2.79,2.79);
   \draw[color=black] (1.75,1.2) node[left] {$R$};
   \draw[thick,->] (3,3) -- +(45:2cm) coordinate (AA);
   \draw[color=black] (3.9,4.4) node[above] {$\varphi$};
   \draw[color=black] (4.7,2) node[above] {$w$};
   \draw[thick,->] (3,3) -- +(-45:2cm) coordinate (BB);
   \draw[thick, ->] (3,3)+(1,0.1) arc (-90:180:1cm)node[below] {$\psi$};
   \point{a}{-{sqrt(8)}}{-{sqrt(8)}};
   \support{3}{a}[45];

   \coordinate (O) at (0,0);
   \coordinate (A) at (-{sqrt(8)},-{sqrt(8)});
   \path (A) -- ($(A)!5mm!90:(O)$)coordinate (A1);
   %\path (A) -- ($(A)!2mm!45:(O)$)coordinate (A2);
   \path (A) -- ($(A)!5mm!(O)$)coordinate (A3);
   \tkzMarkRightAngle(A1,A,A3)   %% Add this

   \coordinate (OO) at (3,3);
   \tkzMarkRightAngle(AA,OO,BB)     %% Add this


 \end{tikzpicture}
 \end{document}

答案3

Harish 展示了正确的方法,但您也可以使用一些棘手的方法。

这些直角标记可以画成方便旋转和移动的小方块。你只需要知道角度原点和旋转的位置。

下一个代码用一个方形空节点绘制一个标记,用 绘制另一个标记rectangle

\documentclass[tikz]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{calc}
\usepackage{structuralanalysis}

\begin{document}
\begin{tikzpicture}[>=triangle 45]
   \draw[thick, ->] (-{sqrt(8)},-{sqrt(8)}) arc (225:-45:4cm)node[below right] {$L$};
   \draw[thick,->] (0,0) -- (2.79,2.79);
   \draw[color=black] (1.75,1.2) node[left] {$R$};
   \draw[thick,->] (3,3) -- (4,4.5);
   \draw[color=black] (3.9,4.4) node[above] {$\varphi$};
   \draw[color=black] (4.7,2) node[above] {$w$};
   \draw[thick,->] (3,3) -- (4.5,2);
   \draw[thick, ->] (4,3.5) arc (-90:180:1cm)node[below] {$\psi$};
   \point{a}{-{sqrt(8)}}{-{sqrt(8)}};
   \support{3}{a}[45];

   \node[minimum size=3mm, inner sep=0pt, draw=green, 
     anchor=south west, rotate=-atan(1/1.5)] at (3,3) {};

   \begin{scope}[shift={(a)}, rotate=45]
      \draw[red] (0,0) rectangle ++(2mm,2mm);
   \end{scope}

\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容