In the code below, I want to change the length of the bottom line- the red arrow, see image attached. I am aware how to do this in a usual line of code, but this piece of code (copied and pasted to create a perpendicular line, I am not sure off, I have tried length=3, length=3cm , after the '<->' but it renders an error. Many thanks !

\documentclass[journal]{IEEEtran}
\usepackage{pgf,pgfarrows,pgfnodes,pgfautomata,pgfheaps}
\usepackage{graphicx}
\usepackage[T1]{fontenc}
\usepackage{amsfonts}
%\usepackage[pdftex]{graphicx}
% Comment the following line to NOT allow the usage of umlauts
\usepackage{pgfgantt}
\usetikzlibrary{angles,calc,math}
\usepackage{tkz-euclide}
\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--(0.1,-0.28);
\node [below] at (3.6, 1.3) {$L_p$};
\draw ->, ultra thick--(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);
\drawthick--(6,2.6);
\drawthick--(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.5,2.7) {H(X,T)};
%\node[color=blue] at (5.4,2.3){dfd};
%\tkzDefLineorthogonal=through C;
%\tkzDrawLine,add = .6 and 0.02,color=black;
\coordinate (O) at (5.7,2.5) ;
\coordinate (E) at (5.4,2.35);
\draw[thick] (O)--(E) nodepos=3.0,color=white{a} ;
\draw[red,<->,thin,transform canvas={rotate around={90:(x)}}] (O) -- (E) ;
\end{tikzpicture}}
\end{figure}
\end{document}

shorten- see: https://tex.stackexchange.com/questions/311213/how-does-the-shorten-option-work – hpekristiansen Nov 15 '20 at 19:46