mathematica manipulate命令使用使用小弟初学mathematica,有些问题想请教下大哥大姐们.x =.; y =.x1 = 2; y1 = 0;x2 = 0; y2 = -1;ob = Graphics[Line[{{x1,y1},{x2,y2 - a}}],Axes -> True] /.a -> 1;eq1 = (y - y1)/(x - x1) == (y - y2 + a)/
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/01 06:32:09
![mathematica manipulate命令使用使用小弟初学mathematica,有些问题想请教下大哥大姐们.x =.; y =.x1 = 2; y1 = 0;x2 = 0; y2 = -1;ob = Graphics[Line[{{x1,y1},{x2,y2 - a}}],Axes -> True] /.a -> 1;eq1 = (y - y1)/(x - x1) == (y - y2 + a)/](/uploads/image/z/13397775-15-5.jpg?t=mathematica+manipulate%E5%91%BD%E4%BB%A4%E4%BD%BF%E7%94%A8%E4%BD%BF%E7%94%A8%E5%B0%8F%E5%BC%9F%E5%88%9D%E5%AD%A6mathematica%2C%E6%9C%89%E4%BA%9B%E9%97%AE%E9%A2%98%E6%83%B3%E8%AF%B7%E6%95%99%E4%B8%8B%E5%A4%A7%E5%93%A5%E5%A4%A7%E5%A7%90%E4%BB%AC.x+%3D.%3B+y+%3D.x1+%3D+2%3B+y1+%3D+0%3Bx2+%3D+0%3B+y2+%3D+-1%3Bob+%3D+Graphics%5BLine%5B%7B%7Bx1%2Cy1%7D%2C%7Bx2%2Cy2+-+a%7D%7D%5D%2CAxes+-%3E+True%5D+%2F.a+-%3E+1%3Beq1+%3D+%28y+-+y1%29%2F%28x+-+x1%29+%3D%3D+%28y+-+y2+%2B+a%29%2F)
mathematica manipulate命令使用使用小弟初学mathematica,有些问题想请教下大哥大姐们.x =.; y =.x1 = 2; y1 = 0;x2 = 0; y2 = -1;ob = Graphics[Line[{{x1,y1},{x2,y2 - a}}],Axes -> True] /.a -> 1;eq1 = (y - y1)/(x - x1) == (y - y2 + a)/
mathematica manipulate命令使用使用
小弟初学mathematica,有些问题想请教下大哥大姐们.
x =.; y =.
x1 = 2; y1 = 0;
x2 = 0; y2 = -1;
ob = Graphics[Line[{{x1,y1},{x2,y2 - a}}],Axes -> True] /.
a -> 1;
eq1 = (y - y1)/(x - x1) == (y - y2 + a)/(x - x2) /.a -> 1;
x3 = (x1 + x2)/2;
eq2 = x == x3;
temp1 = x /.Solve[{eq1,eq2},{x,y}];
temp2 = y /.Solve[{eq1,eq2},{x,y}];
ve = ContourPlot[x == x3,{x,0,2},{y,temp2,0},Frame -> False,
Axes -> True];
Show[ob,ve]
写了几行代码,运行后是这样的
(抱歉,
现在想改变a的值,然后垂直线也随着斜线的改变而改变
Manipulate[Show[ob,ve],{a,0,1}]
mathematica manipulate命令使用使用小弟初学mathematica,有些问题想请教下大哥大姐们.x =.; y =.x1 = 2; y1 = 0;x2 = 0; y2 = -1;ob = Graphics[Line[{{x1,y1},{x2,y2 - a}}],Axes -> True] /.a -> 1;eq1 = (y - y1)/(x - x1) == (y - y2 + a)/
你犯了两点错误:一是Manipulate[Show[ob,ve],{a,0,1}]的话Mathematica会把此式子中的a作为局部变量,外部的a就不算数了;二是你用了两个 /.a -> 1,这是把式子中的a全部换成1,并没有真的给a赋了值,无论a原本是什么值都与其无关.