tikz 绘制垂直线

tikz 绘制垂直线

我从论坛上的另一个帖子中复制粘贴了一些代码,它确实有效,但是我不确定如何更改线的长度。在附图中,该线标记为 H(X,T)。我希望该线垂直于平面 - 穿过标记为 (dfd) 的蓝色节点和 F(X,T) 的点,就像它那样。但我不希望它像现在这样低于 dfd。

这是我使用的代码:

\node[right] at (4.1,2.5) {H(X,T)};
\coordinate (C) at (7,3);
\coordinate (O) at (5.4,2.3);
\node[color=blue] at (5.4,2.3){dfd};
  \tkzDefLine[orthogonal=through C](C,O);
  \tkzDrawLine[,add = .6 and 0.02,color=black](O,tkzPointResult);

并更改第一个参数 - 0.6 会缩短从另一端的长度,因此例如 0.4 太短以至于无法与 F(X,T) 相交,我不确定另一个参数的作用是什么,我已更改它但没有发现任何差异。我想控制的是线从另一端的长度。

(另外,我如何将其变成箭头,当我尝试时 \tkzDrawLine[<->,add = .6 and 0.02,color=black](O,tkzPointResult)它产生了错误。

在此处输入图片描述

完整代码在这里:

\usepackage{pdflscape}

% Start the docu

\usepackage{xcolor}
\usetikzlibrary{positioning}

\usepackage{amsmath}
\usepackage{tikz}

\bibliographystyle{IEEEtran}

%\pagestyle{fancyplain}




 \begin{document}



\begin{figure}
\centerline
{\begin{tikzpicture}
\draw[dashed] (0,0)--(7,3);
\draw[dashed] (7,3)--(7,0);
\draw [dashed] (7,0)--(0,0);
\node[right]  at (0.6,0.1) {$\theta$};
\draw[<->, ultra thin,gray](7.1,2.7)--(0.1,-0.28);
\node [below] at (3.6, 1.3) {$L_p$};


\draw [->, ultra thick](7,3)--(6.6,2.8) ;
%^ x axis

%addgravitylabel
\draw[->, ultra thick] (3,4)--(3,3.5);
\node[left] at (3,4.0){$\bf{g}$};


\node [below] at (6.8,2.9) {X};

% S(X) 
\draw [thick ] (4,1.75) to [out=90,in=180] (5,2.15);
to [out=0,in=180] (5.5,2.0) to [out=0,in=-135] (6.0,2.6);
\draw [thick] (6,2.6) to [out=90,in=180] (7,3.05);
\draw[thick](5,2.15)--(6,2.6);
\draw[thick](4,1.75)--(0,0);





%F(X,T)
\draw [thick, ] (0,1) to [out=90,in=180] (1,1.45)
to [out=0,in=180] (1.5,1.37) to [out=0,in=-135] (2.0,1.9) ;
\draw [,thick, ] (2,1.9) to [out=90,in=180] (3,2.35)
to [out=0,in=180] (3.5,2.25) to [out=0,in=-135] (4.0,2.75);
\draw [,thick, ] (4,2.75) to [out=90,in=180] (5,3.2)
to [out=0,in=180] (5.5,3.1) to [out=0,in=-135] (6.0,3.6);
\draw [,thick,] (6,3.6) to [out=90,in=180] (7,4.05);



\draw [thin, ] (2.5,0) to [out=90,in=0] (2,0.85);


%length and depth

%free-surfacelabel
%inclineplanelabel 

\draw[ <-, thin] (6,2.6)--(5.5,4.3);
\draw[<-, thin] (1,1.45)--(-0.7,2.8);
\node at (5.5,4.3) {$S(X)$};
%\node[above]
\node at  (-0.8,3) {$F(X,T)$};

% Z AXIS To change
\draw [->,ultra thick] (7,3)--(6.7,3.5);
\node[right]  at (7,3.3) {Z};


% PERPENDICULAR QUESTION HERE !!
%\draw [<->,thin] (3.6,1.5)--(3.55,2.28) ;
\node[right] at (4.1,2.5) {H(X,T)};
\coordinate (C) at (7,3);
\coordinate (O) at (5.4,2.3);
\node[color=blue] at (5.4,2.3){dfd};
  \tkzDefLine[orthogonal=through C](C,O);
  \tkzDrawLine[,add = .6 and 0.02,color=black](O,tkzPointResult);




\end{tikzpicture}}

\end{figure}
\end{document}

相关内容