# How to draw a circular, inclined road in 3D?

I want to draw the road which is similar to the following (but please ignore grass, soil, and the surrounding scenery for the sake of simplicity),

to illustrate a physics problem about circular motion. I have not tasted the power of pst-solides3d because of its lengthy documentation. My attempt is as follows but it looks not so good in 2D.

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-node}
\begin{document}
\begin{pspicture}[dimen=m](-5,0)(5,4)
\pscustom[fillstyle=solid,fillcolor=gray]{\pspolygon(-5,0)(-5,1)(-1,0)\scale{-1 1}\pspolygon(-5,0)(-5,1)(-1,0)}
\bgroup
\psset{linecolor=lightgray}
\psline(0,4)(0,3.5)
\psline(0,3.25)
\psellipticarc{->}(0,3.5)(1,.25){-90}{270}
\egroup
\pcline[linestyle=none](-5,1)(-1,0)\naput[nrot=:U,npos=.25,labelsep=-.5\pslinewidth]{\rput(.5,.5){\small car}\psframe(0,.25)(1,.75)\psline[linewidth=3pt](.25,0)(.25,.25)\psline[linewidth=3pt](.75,0)(.75,.25)}
\end{pspicture}
\end{document}


I want to draw the complete circuit first and move the viewport such that it looks like the first image above. I believe your answer will help me to learn the rest easily.

-
The road is not a really a inclined circle, but part of a surface. Perhaps parts of a paraboloid will better fit your purposes. –  Christian Hupfer Mar 10 '14 at 18:17
@StevenB.Segletes: Yes, I know about centripetal force also ;-) All I was writing was to state the form of road is not circular at all since it is a surface with curvature, not just a curve. –  Christian Hupfer Mar 10 '14 at 18:33
@ChristianH. And I was writing merely to point out that a paraboloid would not mathematically suffice, except under perhaps extremely restricted conditions (e.g., step jump from zero to maximum road curvature). –  Steven B. Segletes Mar 10 '14 at 18:35
@steven how I wish it was that simple :) my msc diploma would be 1 year earlier hehe. the cars cannot turn without sliding but I know what you mean. It is just my bad memories :D –  percusse Mar 10 '14 at 19:46
@percusse Well, of COURSE I'm assuming the spherical automobile! Didn't I make that clear? ;^) –  Steven B. Segletes Mar 10 '14 at 19:49

Well, here's a start. Using Jeff Hein's (quite brilliant) tikz-plot3d (suggested by your tag), I have built at least the outer and inner bounds of a racetrack (in magenta). All other elements you wish to include, as well as the viewing angle, may be implemented with this package (I think), and would probably provide a great familiarisation course in the package.

As a first step, I recommend playing around with the values in \tdplotsetmaincoords{80}{110} and observing the different viewing angles...

\documentclass[border=12pt]{standalone}

\usepackage{tikz}
\usepackage{tikz-3dplot}

\begin{document}

\tdplotsetmaincoords{80}{110}
%
\pgfmathsetmacro{\rvec}{.8}
\pgfmathsetmacro{\thetavec}{30}
\pgfmathsetmacro{\phivec}{60}
%
\begin{tikzpicture}[scale=5,tdplot_main_coords]
\coordinate (O) at (0,0,0);
\draw[thick,->] (0,0,0) -- (1,0,0) node[anchor=north east]{$x$};
\draw[thick,->] (0,0,0) -- (0,1,0) node[anchor=north west]{$y$};
\draw[thick,->] (0,0,0) -- (0,0,1) node[anchor=south]{$z$};
\tdplotsetcoord{P}{\rvec}{\thetavec}{\phivec}
\draw[-stealth, color=red] (O) -- (P);
\draw[dashed, color=red] (O) -- (Pxy);
\draw[dashed, color=red] (P) -- (Pxy);
\tdplotdrawarc{(O)}{0.2}{0}{\phivec}{anchor=north}{$\phi$}
\tdplotsetthetaplanecoords{\phivec}
\tdplotdrawarc[tdplot_rotated_coords]{(0,0,0)}{0.5}{0}%
{\thetavec}{anchor=south west}{$\theta$}
\draw[dashed,tdplot_rotated_coords] (\rvec,0,0) arc (0:90:\rvec);
\draw[dashed] (\rvec,0,0) arc (0:90:\rvec);
\draw[thick, color=magenta] (\rvec/2,0,0) arc (0:180:\rvec/2); % inner edge of racetrack
\draw[thick, color=magenta] (\rvec,0,0.3) arc (0:180:\rvec); % outer edge of racetrack
\end{tikzpicture}
\end{document}


-
What did you do folks? –  kiss my armpit Mar 17 '14 at 17:41