Forgot password?
 Create new account
View 105|Reply 0

用MMA画曲线的交点

[Copy link]

462

Threads

969

Posts

9934

Credits

Credits
9934

Show all posts

青青子衿 Posted at 2024-6-19 01:32:02 |Read mode
Last edited by 青青子衿 at 2024-6-19 13:14:00数值求解交点,加上交点的标签
  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"]]
Copy the Code

手机版Mobile version|Leisure Math Forum

2025-4-20 11:52 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list