【问题标题】:jsxgraph reflection of polygon, circle etc多边形,圆形等的jsxgraph反射
【发布时间】:2018-05-10 09:09:17
【问题描述】:

有一个点反射选项 (link)。是否有其他形状(如多边形、圆形、线、角度等)的反射选项? 我已经尝试过了,但它不适用于圆形,但可以很好地处理积分。

        var board = JXG.JSXGraph.initBoard('jxgbox', { boundingbox: [-5, 5, 5, -5], axis: true });
    linePt1 = board.create('point',[0,0],{name:''});
    linePt2 = board.create('point',[2,2],{name:''});

    p1 = board.create('point',[1,3],{name:''});
    p2 = board.create('point',[1,2],{name:''});
    c1 = board.create('circle', [p1, p2]);

    theLine = board.create('line',[linePt1,linePt2],{dash:1});


    i1 = board.create('point',[3,3],{name:''});
    i2 = board.create('point',[3,2],{name:''});
    c2 = board.create('circle', [i1, i2]);

    initialPt = board.create('point',[3,1],{name:'initial pt'});
    transform = board.create('transform',[theLine],{type:'reflect'});
    board.create('point',[initialPt,transform],{name:'reflection'});

    transform1 = board.create('transform',[theLine],{type:'reflect'});
    board.create('circle',[c2,transform1],{name:'reflection1'});
    board.update();

谢谢

【问题讨论】:

    标签: jsxgraph


    【解决方案1】:

    今晚的夜间构建将包含对弧、扇区、圆和角度应用变换的可能性。此外,元素reflectionmirrorelement允许这些元素arcsectorcircleangle作为输入元素。缺点 - 至少目前 - 是生成的元素是弧、扇区和角度的曲线。当输入元素是圆时,结果元素是圆锥截面。原因是当对例如应用任意变换时一个圆,这个圆将是一个圆锥。

    这是一个扩展示例:

    var board = JXG.JSXGraph.initBoard("jxgbox", {
        boundingbox: [-5, 5, 5, -5],
        axis: true
    });
    
    // reflection line
    var li = board.create('line', [1,1,1], {
        strokeColor: '#aaaaaa', name: 'reflection line', withLabel: true});
    var reflect = board.create('transform', [li], {type: 'reflect'});
    var t = board.create('transform', [2, 1.5], {type: 'scale'});
    
    // Mirror point
    var p1 = board.create('point', [-0.5, 0], {name: "Mirror point"});
    
    var c1 = board.create('circle', [[1.3, 1.3], [0, 1.3]], 
        {strokeColor: 'black', center: {visible:true}});
    var c2 = board.create('circle', [c1, t], {strokeColor: 'black'});
    var c3 = board.create('reflection', [c1, li], {strokeColor: 'black'});
    var c4 = board.create('mirrorelement', [c1, p1], {strokeColor: 'black'});
    // c2, c3, c4 are conics
    
    var a1 = board.create('arc', [[1, 1], [0, 1], [1, 0]], 
        {strokeColor: 'red'});
    var a2 = board.create('curve', [a1, t], {strokeColor: 'red'});
    var a3 = board.create('mirrorelement', [a1, p1], {strokeColor: 'red'});
    var a4 = board.create('reflection', [a2, li], {strokeColor: 'red'});
    // a2, a3, a4 are curves
    
    var s1 = board.create('sector', [[-3.5,-3], [-3.5, -2], [-3.5,-4]], 
        {
            anglepoint: {visible:true}, 
            center: {visible: true}, 
            radiuspoint: {visible: true}, 
            fillColor: 'yellow', strokeColor: 'black'});
    var s2 = board.create('curve', [s1, reflect], 
        {fillColor: 'yellow', strokeColor: 'black'});
    var s3 = board.create('mirrorelement', [s1, p1], 
        {fillColor: 'yellow', strokeColor: 'black'});
    var s4 = board.create('reflection', [s2, li], 
        {fillColor: 'yellow', strokeColor: 'black', fillOpacity: 0.5});
    // s2, s3, s4 are curves
    var an1 = board.create('angle', [[-4,3.9], [-3, 4], [-3, 3]]);
    var an2 = board.create('curve', [an1, t]);
    var an3 = board.create('reflection', [an1, li]);
    // an2, an3 are curves 
    

    请试一试。

    最好的祝愿, 阿尔弗雷德

    【讨论】:

      【解决方案2】:

      几周以来,每晚构建已经包含对线、多边形和曲线应用变换的能力。下周我们将添加圆、弧、扇形和角度。

      【讨论】:

      • 酷,我会试试的。谢谢回复:)
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-08-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多