(1)Plot画平面曲线y=1-2x和y=4x-2
Plot[{1 - 2 x, 4 x - 2}, {x, -5, 5}, PlotLegends -> "Expressions",
AxesLabel -> {"x", "y"}, LabelStyle -> "Input", ImageSize -> {300}]
结果如下图:
(2)Graphics函数绘制平面区域
Graphics[{Thick, Green, Rectangle[{1, -1}, {2, 1}], Red, Disk[], Blue,
Circle[{2, 0}], Yellow, Polygon[{{2, 0}, {4, 1}, {6, 0}, {4, -1}}],
Purple, Arrowheads[Large],
Arrow[{{0, -1}, {4, -1}, {4, 1}, {0, 1}, {0, 0}}], Black, Dashed,
Line[{{-1, 0}, {4, 0}}]}]
结果如下图:
(3)绘制三维曲面图
Plot3D[{x^2 + y^2, -x^2 - y^2}, {x, -2, 2}, {y, -2, 2},
RegionFunction -> Function[{x, y, z}, x^2 + y^2 <= 4],
BoxRatios -> Automatic]
Show[ContourPlot3D[{2*x^2 + 3*y^2 == z, 4 - 2*x^2 - y^2 == z}, {x, -2,
3}, {y, -3, 3}, {z, -2, 5}, ContourStyle -> Opacity[0.3],
Mesh -> None, BoundaryStyle -> None, Boxed -> True]]