1
$\begingroup$
t[x_, y_] := x + y;
T = Table[t[x, y], {y, -1, 1, 1}, {x, -1, 1, 1}]
(*{{-2, -1, 0}, {-1, 0, 1}, {0, 1, 2}}*)
x[i_, j_] := T[[i]][[j]];
y[i_, j_] := T[[i]][[j]] + 1;
z[i_, j_] := T[[i]][[j]] + 2;
x[1, 1] (* -2 *)
y[1, 1] (* -1 *)
z[1, 1] (* 0 *)
ParametricPlot3D[{x[i, j], y[i, j], z[i, j]}, {i, 1, 3}, {j, 1, 3}]

Part::pkspec1: The expression 1.0000013571428572' cannot be used as a part specification. Part::pkspec1: The expression 1.0000013571428572' cannot be used as a part specification. Part::pkspec1: The expression 1.0013585` cannot be used as a part specification. General::stop: "Further output of Part::pkspec1 will be suppressed during this calculation. "

I define a table T, then want to ParametricPlot3D (x,y,z). But there are these error information. How to solve this?

$\endgroup$

2 Answers 2

1
$\begingroup$

Your i and j can only take on 3 discrete values since they are part specifications. So you can build up an array of values and make a ListPointPlot3D from them,

Flatten[Array[{x[#1, #2], y[#1, #2], z[#1, #2]} &, {3, 3}], 
  1] // ListPointPlot3D

Mathematica graphics

Or, since they are all in a line, make a Line

Flatten[Array[{x[#1, #2], y[#1, #2], z[#1, #2]} &, {3, 3}], 1] // 
  Line // Graphics3D

Mathematica graphics

$\endgroup$
0
1
$\begingroup$

Use the function t directly in ParametricPlot3D:

t[x_, y_] := x + y;
ParametricPlot3D[{t[x, y], t[x, y] + 1, t[x, y] + 2}, {y, -1, 1}, {x, -1, 1}]

or

u[x_, y_] := {t[x, y], 1 + t[x, y], 2 + t[x, y]}; 
ParametricPlot3D[u[x, y], {y, -1, 1}, {x, -1, 1}]

to get

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.