简体   繁体   English

表面高亮部分

[英]Highlighting section(s) of surface

I have analytically verified that a local min of x^2+y^2-x*y lies at the point (1,1) on the condition x+y=2 . 我已经分析验证了x^2+y^2-x*y的局部最小值位于条件x+y=2的点(1,1)上。 Using wxMaxima, can plot the surface 使用wxMaxima,可以绘制表面

plot3d(x^2+y^2-x*y, [x,-2,2],[y,-2,2],[grid, 100,100], [mesh_lines_color,false]);

What I would like to do now is highlight all the points z on the surface that satisfy the condition x+y=2 . 我现在想做的是突出显示表面上满足条件x+y=2所有点z In other words, I'd like to highlight the section of the surface given by the condition. 换句话说,我想强调条件给出的表面截面。 How do I achieve this? 我该如何实现?

Since your question is tagged with gnuplot , here is a way how one could do that in Gnuplot using a parametric plot: 由于您的问题是用gnuplot标记的,因此这是一种使用参数图在Gnuplot中实现此目的的方法:

set terminal pngcairo
set output 'fig.png'

unset key

set isosamples 40
set parametric

set ur [-2:2]
set vr [-2:2]
set zr [0:12]

set xr [-2:2]
set yr [-2:2]

fn(u) = 2-u

splot \
    u,v,u**2 + v**2 - u*v, \
    u,fn(u),u**2 + fn(u)**2 - u*fn(u) w l lc rgb 'red'

The output is then: 输出为: 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM