如何在 Jsxgraph 中施加相对值

如何解决如何在 Jsxgraph 中施加相对值

在下面,图表接近完美。但是 $\lambda_1$ 会随着 $\lambda_0$ 移动。如何绕过这个问题。此外,我还无法将数值与图形的移动联系起来(您会注意到我还没有乘以 $\beta$。

JXG.Options.text.useMathJax = true; var board = JXG.JSXGraph.initBoard('Box',{boundingBox: [0,12,14,0],轴:假}); var grid = board.create('grid',[]);无功 t1 = board.create('text',[.5,5.2,"$A$"]);无功 t2 = board.create('text',[1.9,3.6,"$0$"]);无功 t4 = board.create('text',6.4,"$1$"]);无功 t5 = board.create('text',[1,1.2,function() { return '\\[a = 接受者'+'\\]'; }]); var t5 = board.create('text',.8,function() { 返回 '​​\\[r = 拒绝者'+'\\]'; }]);变量 p1 = board.create('point',5],{name:'',大小:1,strokeColor:'#AE181E',visible:false,fixed:true});变量 p2 = board.create('point',[2,size:1,fixed:true});无功 p3 = board.create('point',4],fixed:true});变量 p4 = board.create('point',6],fixed:true});无功 li1 = board.create('line',[p1,p2],{straightFirst:false,directLast:false,strokeWidth:2});变量 li2 = board.create('line',[p3,p4],strokeWidth:2});变量段1 = board.create('segment',[[2,6]],{strokeColor:'#5F9EA0',fixed:true}); //变量seg2 = board.create('segment',[[6,[6,7]],{strokeColor:'#5F9EA0'});无功p5 = board.create('point',[2.2,fixed:true});变量 p6 = board.create('point',[3.2,fixed:true});无功 t6=board.create('text',[1.4,11.4,function() { return '\\[\\beta'+'\\]'; }]);无功 sl1=board.create('slider',11],[4,[0,0.99]]);

d=[] //d[0]=board.create('slider',1]]); d[0]=board.create('glider',[seg1],strokeColor:'#5F9EA0',fillColor:'#5F9EA0'}); d[1]=board.create('point',visible:false}); d[2]=board.create('point',visible:false}); d[3]=board.create('segment',[d[1],d[2]],{strokeColor:'#AE181E'}); d[4]=board.create('text',[3.5,4.2,"$B$"]); d[5]=board.create('text',[2.5,4.8,function() { return '\[\lambda_0'+'\]'; }]); d[6] = board.create('point',[4.2,visible:false}); d[7] = board.create('point',visible:false}); d[8] = board.create('point',2],visible:false}); d[9]=board.create('segment',[d[6],d[7]],{strokeColor:'#32CD32'});//柠檬绿 d[10]=board.create('segment',d[8]],{strokeColor:'#32CD32'}); d[11] = board.create('text',[4.8,"$r$"]); d[12]=board.create('text',2.8,"$a$"]); d[13] = board.create('text',[5.9,1.8,function() { return '\[(\lambda_0,1-\lambda_0)'+'\]'; }]); d[14] = board.create('点',visible:false}); d[15] = board.create('点',7],visible:false}); d[16] = board.create('segment',[d[14],d[15]],strokeColor:'#5F9EA0'}); d[17] = board.create('text',4.6,"$0$"]); d[18]=board.create('text',7.8,function() { return '\[\beta'+'\]'; }]);

var Grd = board.create('group',d);

c=[] c[0]=board.create('point',[6.2,visible:false}); c[1]=board.create('point',[7.2,visible:false}); c[2]=board.create('segment',[c[0],c[1]],{strokeColor:'#AE181E'}); c[3]=board.create('text',[7.5,"$A$"]); c[4]=board.create('text',[6.5,5.8,function() { return '\[\lambda_1'+'\]'; }]); c[5]=board.create('glider',[d[16]],fillColor:'#5F9EA0'}); c[6] = board.create('point',[8.2,visible:false}); c[7] = board.create('point',[10,visible:false}); c[8] = board.create('point',3],visible:false}); c[9]=board.create('segment',[c[6],c[7]],{strokeColor:'#AE181E'});//柠檬绿 c[10]=board.create('segment',c[8]],{strokeColor:'#AE181E'}); c[11] = board.create('text',[8.8,6.2,"$r$"]); c[12]=board.create('text',3.8,"$a$"]); c[13] = board.create('text',[9.8,7.4,"$(0,0)$"]); c[14] = board.create('text',function() { return '\[(\beta \lambda_1,\beta (1-\lambda_1)\]'; }]);//"$(\beta \lambda_1,\beta(1-\lambda_1))$"]); //d[5]=board.create('text',function() { 返回 '\[(\lambda_0 = '+((d[0].coords.usrCoords[2]-4)/2).toFixed(2)+'\]'; }]);无功grc = board.create('group',c); var val1=board.create('text',function() { 返回 '\[( '+(((d[0].coords.usrCoords[2]-4)/2).toFixed(2)+','+(1-((d[0].coords.usrCoords[2]-4) /2)).toFixed(2)+')\]'; }]); var val2=board.create('text',[8.9,function() { return '\[( '+(((c[5].coords.usrCoords[2]-5)/2).toFixed(2)+','+(1-((c[5].coords.usrCoords[2]-5) /2)).toFixed(2)+')\]'; }]);

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?
Java在半透明框架/面板/组件上重新绘画。
Java“ Class.forName()”和“ Class.forName()。newInstance()”之间有什么区别?
在此环境中不提供编译器。也许是在JRE而不是JDK上运行?
Java用相同的方法在一个类中实现两个接口。哪种接口方法被覆盖?
Java 什么是Runtime.getRuntime()。totalMemory()和freeMemory()?
java.library.path中的java.lang.UnsatisfiedLinkError否*****。dll
JavaFX“位置是必需的。” 即使在同一包装中
Java 导入两个具有相同名称的类。怎么处理?
Java 是否应该在HttpServletResponse.getOutputStream()/。getWriter()上调用.close()?
Java RegEx元字符(。)和普通点?