- Clear["Global`*"]
- G = 6.67259*10^(-11);
- Manipulate[Fg = G*(M*m)/r^2;
- Show[Plot[G*(M*m)/R^2, {R, 0, 1},
- PlotRange -> {{0, 1.2}, {0, 2*10^(-8)}}],
- Graphics[{Red, PointSize[Large],
- Tooltip[Point[#], #] &[{r, G*(M*m)/r^2}]}]],
- Row[{Control[{{M, 5}, 1, 10, 0.01}], " ", Dynamic[M], "(kg)"}],
- Row[{Control[{{m, 1}, 1, 10, 0.01}], " ", Dynamic[m], "(kg)"}],
- Row[{" ", Control[{{r, 0.3}, 0.1, 1, 0.01}], " ", Dynamic[r],
- "(metre)"}],
- Text@Style[StringForm["F = ``(N)", Dynamic[Fg]], Black],
- TrackedSymbols :> {M, m, r}]
复制代码 |