Test 1 TM3 05 01i 2nd
Kontrollpunkt an Masse B (vertikal beweglich, z.B. als slider). Wenn man daran zieht, soll sich Masse A mit der Rolle darüber passend bewegen. Beim Loslassen geht das System in die Ausgangslage zurück.
by aaronamran
HTML
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jsxgraph/distrib/jsxgraphcore.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jsxgraph/distrib/jsxgraph.css">
<div id="jxgbox" class="jxgbox" style="width:500px; height:500px">
</div>
<p id="init">[
[ "grid", "","", -2, 3.5, -9, 0.8, 40 ],
[ "wall", "", [-1, 0], [2.5, 0], 45 ],
[ "circle", "", [1,-1], 0.5 ],
[ "circle", "", [0,-3], 0.5 ],
[ "rope", "", [0,-3], -0.5, [0,0], -0.5 ],
[ "rope", "", [0,-3], 0.5, [1,-1], -0.5 ],
[ "rope", "", [1,-1], -0.5, [1.5, -5], 0 ],
[ "rope", "", [1,-1], 0, [1, 0], 0 ],
[ "rope", "", [0,-3], 0, [0,-5.5], 0 ],
[ "beam", "", [0,-4.5], [0,-5.5], 0.5],
[ "beam", "", [1.5, -5], [1.5, -5.5], 0.5],
[ "disp", "s_A", [-1, -5], -90],
[ "disp", "s_B", [2.5, -5], 90],
[ "label", "\\(A\\)", [-0.2, -6] ],
[ "label", "\\(B\\)", [1.3, -6] ],
[ "node", " ", [0,-3] ],
[ "node", " ", [1,-1] ]
]
</p>
<p id="data"></p>
<p id="fbd_names"></p>
<!--
pA:[0,-4]; pB:[1,-2]; pC: [1,-2]+[0.5, -4];
[ "dashpot", "d", [10,9], [14,9], 0.5, 1, "show"],
[ "fix1", "A", [1, 7], 60, "show" ],
[ "fix12", "B", [3, 7], 60, "show"],
[ "fix123", "C", [5, 7], 60, "show" ],
[ "fix13", "D", [7,7], 60, "show" ],
[ "line", "", [6, 7, 8, 9], [1, 3, 1, 3], "--" ,0.8],
[ "polygon", "",[10,8],[10,5], [11,5], [11,6], [12,6], [12,5], [13,5], [13, 8], "show"],
[ "circle", "c1", [2,9], 0.5, 45, "show" ],
[ "circle", "c2", [5,9], 0.5, 45, "show" ],
[ "rope", " ", [2,9], 0.5, [5,9], 0.5, "show" ],
[ "springc", "c", [2, 5], [6,5], 0.5, 10, "show" ],
[ "springt", "t", [2, 2], [6,2], 0.5, 30, 9, "show" ]
-->
JavaScript
// Start of jsfiddle header.
var mode = "jsfiddle";
var divid = "jxgbox";
var fbd_names = "fbd_names";
var stateRef = "data";
var initstring = document.getElementById("init").innerHTML;
const centeredLabelStyle = {
size: 0,
showInfobox: false,
label: {
offset: [0, 0],
anchorX: 'middle',
anchorY: 'middle'
}
};
/*
Fixed GitHub Issues that are implemented in this JS code:
#11 : Option to lock objects in hidden state (bar, beam, circle, dashpot, fix1, fix12, fix123, fix13, polygon, q, rope, springc, springt, wall)
#12 : Make the beam object clickable
#13 : Suppress infobox at "rot" points
#28 : Move "force" by dragging the vector
#30 : "force": Prevent forces to have zero length
#35 : Make toStack() more robust (cleanupName())
#37 : Grid lines to the background
https://github.com/mkraska/meclib/wiki/Moving-objects-by-scripts
*/
// https://github.com/mkraska/meclib/wiki
// version info
const versionText= "JXG "+JXG.version+" Meclib 2023 08 16";
const highlightColor = "orange";
const movableLineColor = "blue";
const loadColor = "blue";
const defaultMecLayer = 6;
let pxunit = 1/40; // is reset by "grid"
let a = 16*pxunit; // is reset by "grid"
const deg2rad = Math.PI/180, rad2deg = 180/Math.PI;
const tolPointLine = 0.001;
let xscale = 1, yscale = 1; // default scale for infobox, can be modified by "grid"
let dpx = 1, dpy = 1; // default decimal precision for infobox, can be modified by "grid"
// infobox settings, further settings after board initiation
JXG.Options.infobox.layer = defaultMecLayer+5;
JXG.Options.infobox.strokeColor = 'black';
JXG.Options.infobox.cssStyle = 'background-color: #ffffffdd;'
// snap settings. Interactive objects are handled explicity
JXG.Options.point.snapToGrid = false; // grid snap spoils rotated static objects
JXG.Options.point.snapSizeX = 0.1;
JXG.Options.point.snapSizeY = 0.1;
// interactive objects are released explicitly
JXG.Options.point.fixed = true;
JXG.Options.line.fixed = true;
JXG.Options.circle.fixed =...