0
$\begingroup$

I've been trying to evaluate this line

ParametricPlot3D[{x, radii[x]*Cos[t], 
  radii[x]*Sin[t] + centers[x][[2]], EdgeForm[]}, {t, 0, 2 Pi}, {x, 
  lowerx, upperx}, ViewPoint -> {1, -3, .5}, PlotPoints -> {20, 20}, 
 Boxed -> False, ImageSize -> 350, Axes -> False]

but nothing comes up, I'm not sure where have I gone wrong These are the definitions,

upperx = Min[bottommaxx, topmaxx];
lowerx = Max[bottomminx, topminx];
centers[x_] = {x, (top[x] + bottom[x])/2};
radii[x_] = (top[x] - bottom[x])/2;
$\endgroup$
10
  • 1
    $\begingroup$ what are radii, centers, lowerx, upperx ? $\endgroup$ Commented Oct 18, 2014 at 3:53
  • 1
    $\begingroup$ you need to remove , EdgeForm[]. $\endgroup$
    – kglr
    Commented Oct 18, 2014 at 3:54
  • $\begingroup$ @Algohi Does that mean I have to input the values in the line? Sorry, first time user :) $\endgroup$
    – Dinar
    Commented Oct 18, 2014 at 4:04
  • $\begingroup$ @kguler tried, still does not work $\endgroup$
    – Dinar
    Commented Oct 18, 2014 at 4:07
  • 1
    $\begingroup$ I think you have definition for them. but we can't help you because simply we cannot run your code. either provide them in your question or use suggestion of kguler and see if it helps. $\endgroup$ Commented Oct 18, 2014 at 4:10

1 Answer 1

1
$\begingroup$

In order to get things work I advise you to first check out help page for the function you're planning to use.

Here, lets check out ParametricPlot3D. And then look up your code for differences.

ParametricPlot3D[{x, radii[x]*Cos[t], 
radii[x]*Sin[t] + centers[x][[2]], EdgeForm[]}, {t, 0, 2 Pi}, {x, 
lowerx, upperx}, ViewPoint -> {1, -3, .5}, PlotPoints -> {20, 20}, 
Boxed -> False, ImageSize -> 350, Axes -> False]

and for parameters in this code:

upperx = Min[bottommaxx, topmaxx];
lowerx = Max[bottomminx, topminx];
centers[x_] = {x, (top[x] + bottom[x])/2};
radii[x_] = (top[x] - bottom[x])/2;

After comparison you should see that use of EdgeForm[]is not right. And a second warning for the parameters. They still are not enough.

A working code should give parameters clearly as follows:

radii[x_] := x; centers[x_] := {x, x + 1, x + 2};
lowerx := 5; upperx := 10;

ParametricPlot3D[
 {x, radii[x]*Cos[t], radii[x]*Sin[t] + centers[x][[2]]},
 {t, 0, 2 Pi}, {x, lowerx, upperx},
 ViewPoint -> {1, -3, .5},
 PlotPoints -> {20, 20},
 Boxed -> False,
 ImageSize -> 350,
 Axes -> False]

enter image description here

When you define the functions bottom[x] and and top[x]and the lists upperx and lowerx by declaring bottommaxx, topmaxx, bottomminx and topminx your code will work as you want.

$\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.