I am to draw a 3D function, using PSTricks' \parametricplotThreeD
. Coordinate Z in two parameters is so awkward, in terms of controlling boundary values and formulation that I decided to break it into the affordable functions.
For the mathematical function (as an example),
f(t, u) = (1-u)cos(t) + uSin(t/3),
I used some of the tex.stackexchange questions and defined my function as, e.g.,
\documentclass{minimal}
\usepackage{pstricks}
\usepackage{pst-solides3d}%Drawing
\usepackage{pst-3dplot}%
\usepackage[nomessages]{fp}% http://ctan.org/pkg/fp
\begin{document}
\newcommand{\fMathFunction}[2]
{\FPeval\result{(1-#2)(cos(#1)) + (#2)(sin((#1)/3))}\result}.
\parametricplotThreeD[algebraic, xPlotpoints=20,
linecolor=blue,%
linewidth=0.5pt,plotstyle=curve](0, 1)(0, 1){%
t|\fMathFunction{t}{u}|2+sqrt(\fMathFunction{t}{u})}%
\end{pspicture}
\end{document}
I get alot af errors.
I would like to know if defining a function in two variables is possible and how it can be utilised. If I moved, then, additionally I like to define another function, say,
g(t, u) = 2 + sqrt (f(g, u)),
and use it in place of Z.
Edit 1: My goal in this question is not drawing. I like to know if it is possible to define a custom mathematical function in two variables. We already know how to define a custom f(x)
. I like to define a custom f(x,y)
.
g(t,u) = 2 + sqrt(f(t,u))
. Do you have a graphic of what the function should look like?minimal
class, see Why should the minimal class be avoided?