Forgot password?
 Register account
View 225|Reply 0

用MMA画曲线的交点

[Copy link]
青青子衿 posted 2024-6-19 01:32 |Read mode
Last edited by 青青子衿 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"]]
Copy the Code

Quick Reply

Advanced Mode
B Color Image Link Quote Code Smilies
You have to log in before you can reply Login | 快速注册

$\LaTeX$ formula tutorial

Mobile version

2025-6-8 10:34 GMT+8

Powered by Discuz!

Processed in 0.019666 second(s), 25 queries

× Quick Reply To Top Edit