
그래서 저는 Tikz/PGF를 처음 접했고 시간과 거리에 따른 속도의 변화를 보여주는 이미지를 그리려고 합니다.
파란색 선은 물체가 처음에는 한 지점(함수 υ=χ*τ)까지 선형 속도를 갖는다는 것을 보여줍니다. 빨간색 선은 물체가 상수 a=1(함수 x= υ0t - ½ αt^2)로 감속하고 있음을 보여줍니다. 감속 기능을 구현하면 빨간색 곡선이 나타납니다.시간의 축을 따라 움직이지 않는다 티(또는 y축), 속도(0을 향해야 함)와 거리(증가)에 따라 변경됩니다. 내가 도대체 뭘 잘못하고있는 겁니까? 귀하의 팁과 솔루션에 미리 감사드립니다!
\documentclass[border=45pt]{standalone}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\usepackage{pgfmath}
\usepackage{amsmath}
\usepackage{tikz-3dplot}
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture} [
% Define Time with Constant Speed Function
declare function={
linear(\x,\u,\t)= \x / \u;},
%Define Breaking / Deceleration Function with a=1
declare function={
curve(\x,\u,\t)= (\u * \t -(1/2 * 1 * \t^2));}
]
\begin{axis}[
%view={90}{60},
no markers,
zmin=0, zmax=10,
xmin=0, xmax=10,
ymin=0,ymax=10,
xtick={3},
xticklabels={$u_0$},
ytick={2},
yticklabels={$t_{safe}$},
ztick={6},
zticklabels={$x_{MP}$},
axis lines=middle,
zlabel=$x$, zlabel style={at={(rel axis cs:0,0,1)}, anchor=east},
xlabel=$u$, xlabel style={at={(rel axis cs:1,0,0)}, anchor=west},
ylabel=$t$, ylabel style={at={(rel axis cs:0,1,0)}, anchor=south west}
]
%dashed Tsafe
\draw[dashed] (6,2,0)--(0,2,0); % change middle variable = y to move line on y = t axis, also move ticks on above set
%grayrectangle on Tsafe
\fill[fill=gray!13,opacity=0.8] (0,2,0) -- (6,2,0) -- (6,2,6) -- (0,2,6) -- (0,2,0); % change middle variable = y to adjust plane on tsafe axis
%grayrectangle on Xmp
\fill[fill=gray!15, opacity=0.8] (0,0,6) -- (0,4,6) -- (6,4,6)-- (6,0,6) -- (0,0,6); % if MP point changes, change right variable = z to move plane on z = x axis, also move ticks on above set
\addplot3 [blue!50!black, thick,domain=0:1] (3,x, {linear(x,3,0)}); %point (x,u,t) = (3m,3m/s,1s)
\addplot3 [red!50!black,thick,domain=0:3] (3-y,1,{curve(3,5,y)});
\end{axis}
\end{tikzpicture}
\end{document}