4
$Version
ParametricPlot[BezierFunction[RandomInteger[100,{3,2}]][t],{t,0,1}]

10.4.1 for Microsoft Windows (64-bit) (April 17, 2016)

Mathematica graphics

Crazy result.But the documentation have not any specification for this.And the BezierFunction and BSplineFunction have a same behavior in my PC.


And when I input like this

temp = RandomInteger[100, {3, 2}];
ParametricPlot[BezierFunction[temp][t], {t, 0, 1}]

We'll get the right answer.If anybody can confirm this.I'll add a bug for this post and give a support to wolfram.

yode
  • 26,686
  • 4
  • 62
  • 167

1 Answers1

6

What is happening: For every value of t that is sampled a new triple of Randominteger pairs is generated and a new BezierFunction is constructed. So every t that is sampled is processed with a different function. This can be seen using Trace on a simpler version of the problem.

Trace[ParametricPlot[BezierFunction[RandomInteger[100, {3, 2}]][t], {t, 0, 1}, 
  PlotPoints ->3, MaxRecursion -> 0,  AspectRatio -> 1], BezierFunction| RandomInteger]

Mathematica graphics

Solution: Evaluateing the first argument of ParametricPlot or using the option Evaluated->True gives the expected output.

ParametricPlot[Evaluate@BezierFunction[RandomInteger[100, {3, 2}]][t], {t, 0, 1}, 
 AspectRatio -> 1]

Mathematica graphics

ParametricPlot[BezierFunction[RandomInteger[100, {3, 2}]][t], {t, 0, 1}, 
 Evaluated -> True, AspectRatio -> 1]

Mathematica graphics

kglr
  • 394,356
  • 18
  • 477
  • 896