The code as following and the code runs in Mathematica version 14.1.0.
Clear["`*"];
Manipulate[
Module[{circle, center, radius, pointP, pointB, tangentPoint},
circle = Disk[{0, 4}, 1]; center = {0, 4}; radius = 1;
pointP = {a^2/4, a}; pointB = {-1, a};
tangentPoint =
NSolve[EuclideanDistance[{x, y}, center] == radius &&
EuclideanDistance[{x, y}, pointP] ==
Sqrt[radius^2 + EuclideanDistance[pointP, center]^2], {x, y},
Reals];
tangentPoint = {x, y} /. tangentPoint;
Show[ContourPlot[{y^2 == 4 x, x^2 + (y - 4)^2 == 1,
x == -1}, {x, -3, 6}, {y, -8, 8},
ContourStyle -> {Blue, Thick, Dashed, Black},
PerformanceGoal -> "Quality", Frame -> False, Axes -> True,
AxesOrigin -> {0, 0}, AxesLabel -> {"x", "y"},
AspectRatio -> Automatic],
Graphics[{Red, PointSize[0.02], Point[pointP],
Text[Style["P", 12, Italic, FontFamily -> "Times"],
pointP, {-1, -1}], Black, PointSize[0.02], Point[pointB],
Text[Style["B", 12, Italic, FontFamily -> "Times"],
pointB, {1, 0}], Black, Dashed, Line[{pointP, pointB}], Black,
PointSize[0.02], Point[center],
Text[Style["A", 12, Italic, FontFamily -> "Times"],
center, {1, 0}], Black, Line[{pointP, #}] & /@ tangentPoint}],
PlotRange -> {{-3, 6}, {-8, 8}}]], {a, 0, 6}]
After running the code, the image appears normal when stationary, but when I click the button to make the moving point P start moving, an error message is displayed.
NSolve::ratnz: NSolve was unable to solve the system with inexact coefficients. The \
answer was obtained by solving a corresponding exact system and \
numericizing the result.
After adding Rationalize
, why is the problem still there when I run the code in version 14.1.0?
In[]
symbol in the screenshot, have you really executed the code? $\endgroup$