Mathematica Asked by computer891 on March 13, 2021
I am having trouble adding a point to mark the Min values of each parabola when using the Manipulate command?
Manipulate[
Plot[x^2 - 2*(a - 2)*x + a - 2, {a, -20, 20},
PlotRange -> {-200, 200}], {a, -10, 10}]
This gives me the parabolas but how do I get a vertex point visible as it moves with parameter a.
You can use the options MeshFunctions
, Mesh
and MeshStyle
as follows:
Manipulate[Plot[x^2 - 2*(a - 2)*x + a - 2, {x, -20, 20},
ClippingStyle -> False,
MeshFunctions -> {# &},
Mesh -> {{a - 2}},
MeshStyle -> Directive[PointSize[Large], Red],
PlotRange -> {-200, 200}], {a, -10, 10}]
Alternatively, you can use Epilog
Manipulate[Plot[x^2 - 2*(a - 2)*x + a - 2, {x, -20, 20},
Epilog -> {PointSize[Large], Red, Point[{a - 2, -6 + 5 a - a^2}]},
PlotRange -> {-200, 200}], {a, -10, 10}]
where I have used the results from:
Minimize[x^2 - 2*(a - 2)*x + a - 2, x]
{-6 + 5 a - a^2, {x -> -2 + a}}
Correct answer by kglr on March 13, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP