Tag Info

New answers tagged

12

You can use MeshFunctions to do the trick: g = BSplineFunction[{RandomReal[1, 20], RandomReal[1, 20]}\[Transpose]]; dg = g'; ParametricPlot[ g[t], {t, 0, 1}, MeshFunctions -> Function[{x, y, t}, dg[t].{0, 1}], Mesh -> {{0}}, MeshStyle -> Directive[AbsolutePointSize[5], Red] ] Here the MeshFunctions specifies the value of ...


7

A more interesting example with multiple extrema.. g = BSplineFunction[{{1, 2}, {2, 4}, {3, -1}, {4, 2}, {5, 0}, {6, 1}}]; gp = g'; gpy[t_?NumericQ] := gp[t][[2]]; This is utilising Plot to generate the curve and look for zero crossings, which we then pass as starting points to FindRoot loc = Flatten[ t /. # & /@ FindRoot[gpy[t] , ...


1

How about g = BSplineFunction[{{1, 2}, {2, 4}, {3, -1}, {4, 2}}]; gN[t_?NumericQ] := g[t][[2]] So that gN[0.1] returns a number. Then NMinimize[{gN[t], t > 0, t < 1}, t] NMaximize[{gN[t], t > 0, t < 1}, t] (* {1.01494,{t->0.75726}} {2.48728,{t->0.176073}} *) works.


3

BSplineFunction[{{0., 1.}, {0., 1.}}, "<>"] is a map from parametric space to "plotting" space, i.e. $\mathrm{BSplineFunction}:(u,v)\mapsto (x,y,z)$, so instead of Plot3D[surfFn[x/7, y/5][[3]], {x, 0, 7}, {y, 0, 5}], it should be written as ParametricPlot3D[surfFn[u, v], {u, 0, 1}, {v, 0, 1}]. cpts = Table[{x, y, RandomReal[{0, 2}]}, {x, 0, 7}, {y, 0, ...



Top 50 recent answers are included