Skip to content

Mohr's Circle

mkraska edited this page Nov 3, 2021 · 8 revisions

The student can move the circle and the line for the 1-axis using the red points. This is done using the special purpose objects "circle2p" and "line2p". They return their point co-ordinates in the names input field.

f:50;
initdata: [ 
  [ "grid", " ", " ", -6,6, -3, 3, 40, [f,f] ],
  [ "circle2p", "P","P'", [50,50],[100,100], f ],
  [ "line2p", "1-Achse", [200,100],[250,50], f ]
];
init: stackjson_stringify(float(initdata));

tansdata: [ 
  [ "grid", " ", " ", -6,6, -3, 3, 40, [f,f] ],
  [ "circle2p", "P","P'", [50,50],[100,100], f ],
  [ "line2p", "1-Achse", [200,100],[250,50], f ]
];
tans: stackjson_stringify(float(tansdata));

In order to check the points P and P' and the slope of the line, you might use the following in the feedback variables. Note that this relies on object position in the list.

S_P: names[2][1];
S_PP: names[2][2];
[dx,dy]: names[3][2]-names[3][1];

One could extract the co-ordinates from objects as well by object name, but in with that few objects it can be kept simple.

Tryout Space

In order to try code snippets in jsfiddle,

  1. copy the code from the wiki page to the clipboard
  2. follow the link for the JSXGraph version you want to try
  3. Replace the code in the HTML section (contents of <p hidden id="init">) with the content of the clipboard
Clone this wiki locally