找回密码
 快速注册
搜索
查看: 9|回复: 0

用MMA画曲线的交点

[复制链接]

471

主题

945

回帖

9837

积分

积分
9837

显示全部楼层

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

手机版|悠闲数学娱乐论坛(第3版)

GMT+8, 2025-3-4 07:10

Powered by Discuz!

× 快速回复 返回顶部 返回列表