Difference between revisions of "Dependent gliders"
From JSXGraph Wiki
Jump to navigationJump to searchA WASSERMANN (talk | contribs) |
A WASSERMANN (talk | contribs) |
||
Line 11: | Line 11: | ||
B.position = A.position - 0.3; | B.position = A.position - 0.3; | ||
B.prepareUpdate().update(true).updateRenderer(); | B.prepareUpdate().update(true).updateRenderer(); | ||
− | C.setPositionDirectly(JXG.COORDS_BY_USER, A.X()+ | + | |
+ | C.setPositionDirectly(JXG.COORDS_BY_USER, A.X()+3, C.Y()); | ||
C.prepareUpdate().update().updateRenderer(); | C.prepareUpdate().update().updateRenderer(); | ||
− | } | + | } else if (brd.mouse.obj==B) { |
+ | A.position = B.position + 0.3; | ||
+ | A.prepareUpdate().update(true).updateRenderer(); | ||
+ | |||
+ | C.setPositionDirectly(JXG.COORDS_BY_USER, A.X()+3, C.Y()); | ||
+ | C.prepareUpdate().update().updateRenderer(); | ||
+ | } else if (brd.mouse.obj==C) { | ||
+ | A.setPositionDirectly(JXG.COORDS_BY_USER, C.X()-3, A.Y()); | ||
+ | A.prepareUpdate().update().updateRenderer(); | ||
+ | |||
+ | B.position = A.position - 0.3; | ||
+ | B.prepareUpdate().update(true).updateRenderer(); | ||
+ | } else if | ||
}, 'update'); | }, 'update'); | ||
</jsxgraph> | </jsxgraph> |