本帖最后由 青青子衿 于 2024-6-19 13:14 编辑 数值求解交点,加上交点的标签
- coords = ({x, y} /. NSolve[{y^2 == x^3 - x + 1, y == x}, {x, y}]);
- deviations = {{+0.2, -0.3}, {+0.4, -0.2}, {+0.4, -0.2}};
- points =
- MapThread[{Style[
- StringJoin["(", Riffle[Map[ToString, #1], ", "], ")"], Bold,
- Red, Background -> Yellow], #1 + #2} &, {coords, deviations}];
- pointtext = Text[#1, #2] & @@@ points
- ContourPlot[{y^2 == x^3 - x + 1, y == x}, {x, -3, 3}, {y, -3, 3},
- Epilog -> {PointSize[Large], Point[#] & /@ coords, pointtext},
- PlotLegends -> LineLegend["Expressions"]]
复制代码 |