|
|
@@ -135,21 +135,20 @@
|
|
|
" style:\n",
|
|
|
" linecolor: blue\n",
|
|
|
" filled_curves: blue\n",
|
|
|
- " transform: [\"rotate(-theta, contact)\",\"translate(-rl/2*tangent_vec)\"]\n",
|
|
|
+ " transform: [\"rotate(-theta, contact)\",\n",
|
|
|
+ " \"translate(-rl/2*tangent_vec)\"]\n",
|
|
|
"N: \n",
|
|
|
" formula: Force(contact - rl*normal_vec, contact, r'$N$', text_pos='start')\n",
|
|
|
" style:\n",
|
|
|
" linecolor: black\n",
|
|
|
- "mg: \n",
|
|
|
- " formula: Gravity(c, rl, text='$Mg$')\n",
|
|
|
- " style:\n",
|
|
|
- " linecolor: black\n",
|
|
|
"wheel: \n",
|
|
|
" formula: \"Composition({'outer': rectangle})\" \n",
|
|
|
" style:\n",
|
|
|
" shadow: 1\n",
|
|
|
+ "mc:\n",
|
|
|
+ " formula: Text(r'$c$', c)\n",
|
|
|
"body: \n",
|
|
|
- " formula: \"Composition({'wheel': wheel, 'N': N, 'mg': mg})\"\n",
|
|
|
+ " formula: \"Composition({'wheel': wheel, 'N': N, 'mc': mc})\"\n",
|
|
|
" style:\n",
|
|
|
" linecolor: black\n",
|
|
|
"mB:\n",
|
|
|
@@ -160,6 +159,19 @@
|
|
|
" formula: Wall(x=[A[0], B[0]], y=[A[1], B[1]], thickness=-0.25,transparent=False)\n",
|
|
|
" style:\n",
|
|
|
" linecolor: black \n",
|
|
|
+ "x_const: \n",
|
|
|
+ " formula: Line(contact, contact + point(0,4))\n",
|
|
|
+ " style:\n",
|
|
|
+ " linestyle: dotted\n",
|
|
|
+ " transform: rotate(-theta, contact)\n",
|
|
|
+ "x_axis: \n",
|
|
|
+ " formula: \"Axis(start=contact+ 2*rl*normal_vec, length=2*rl,label='$x$', rotation_angle=-theta)\"\n",
|
|
|
+ "plan: \n",
|
|
|
+ " formula: \"Composition({'body': body, 'inclined wall': wall, 'x start': x_const, 'x axis': x_axis, 'mA': mA, 'mB': mB})\"\n",
|
|
|
+ "mg: \n",
|
|
|
+ " formula: Gravity(c, rl, text='$Mg$')\n",
|
|
|
+ " style:\n",
|
|
|
+ " linecolor: black\n",
|
|
|
"angle: \n",
|
|
|
" formula: \"Arc_wText(r'$<bslash>theta$', center=B, radius=3, start_angle=180-theta, arc_angle=theta, fontsize=fontsize)\"\n",
|
|
|
" style:\n",
|
|
|
@@ -171,17 +183,8 @@
|
|
|
" linecolor: black\n",
|
|
|
" linestyle: dashed\n",
|
|
|
" linewidth: 1\n",
|
|
|
- "x_const: \n",
|
|
|
- " formula: Line(contact, contact + point(0,4))\n",
|
|
|
- " style:\n",
|
|
|
- " linestyle: dotted\n",
|
|
|
- " transform: rotate(-theta, contact)\n",
|
|
|
- "x_axis: \n",
|
|
|
- " formula: \"Axis(start=contact+ 2*rl*normal_vec, length=2*rl,label='$x$', rotation_angle=-theta)\"\n",
|
|
|
- "plan: \n",
|
|
|
- " formula: \"Composition({'body': body, 'angle': angle, 'inclined wall': wall, 'x start': x_const, 'x axis': x_axis, 'mA': mA, 'mB': mB})\"\n",
|
|
|
"friction: \n",
|
|
|
- " formula: \"Composition({'plan': plan, 'ground': ground})\"\n",
|
|
|
+ " formula: \"Composition({'plan': plan, 'ground': ground, 'mg': mg, 'angle': angle})\"\n",
|
|
|
"\"\"\""
|
|
|
]
|
|
|
},
|
|
|
@@ -225,20 +228,23 @@
|
|
|
"metadata": {},
|
|
|
"outputs": [],
|
|
|
"source": [
|
|
|
- "angle = myfig['theta']\n",
|
|
|
"def doright(change):\n",
|
|
|
- " global angle\n",
|
|
|
" rotate(-5)\n",
|
|
|
- " angle += 5\n",
|
|
|
"def doleft(change):\n",
|
|
|
- " global angle\n",
|
|
|
" rotate(5)\n",
|
|
|
- " angle -= 5\n",
|
|
|
"def rotate(theta):\n",
|
|
|
- " global angle\n",
|
|
|
+ " angle = myfig['theta']\n",
|
|
|
+ " angle -= theta\n",
|
|
|
+ " myfig['theta'] = angle\n",
|
|
|
" drawing_tool.erase()\n",
|
|
|
- " myfig['plan']['angle'].changeAngles(180-angle,angle)\n",
|
|
|
+ " x = myfig['plan']['body']['mc'].x\n",
|
|
|
+ " y = myfig['plan']['body']['mc'].y\n",
|
|
|
" myfig['plan'].rotate(theta,myfig['B'])\n",
|
|
|
+ " xf = myfig['plan']['body']['mc'].x\n",
|
|
|
+ " yf = myfig['plan']['body']['mc'].y\n",
|
|
|
+ " trans = point(xf-x,yf-y)\n",
|
|
|
+ " myfig['angle'].changeAngle(180-angle, angle)\n",
|
|
|
+ " myfig['mg'].translate(trans)\n",
|
|
|
" myfig['friction'].draw()"
|
|
|
]
|
|
|
},
|
|
|
@@ -283,7 +289,7 @@
|
|
|
{
|
|
|
"data": {
|
|
|
"application/vnd.jupyter.widget-view+json": {
|
|
|
- "model_id": "83e8b7e739ef4b3c95a755a92d105b51",
|
|
|
+ "model_id": "7353158e16224023a1a98fc5f4fd2830",
|
|
|
"version_major": 2,
|
|
|
"version_minor": 0
|
|
|
},
|
|
|
@@ -333,6 +339,87 @@
|
|
|
"Use left and right rotation button to rotate the sketch"
|
|
|
]
|
|
|
},
|
|
|
+ {
|
|
|
+ "cell_type": "code",
|
|
|
+ "execution_count": null,
|
|
|
+ "metadata": {},
|
|
|
+ "outputs": [],
|
|
|
+ "source": [
|
|
|
+ "angle = myfig['theta']"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "cell_type": "code",
|
|
|
+ "execution_count": null,
|
|
|
+ "metadata": {},
|
|
|
+ "outputs": [],
|
|
|
+ "source": [
|
|
|
+ "angle"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "cell_type": "code",
|
|
|
+ "execution_count": null,
|
|
|
+ "metadata": {},
|
|
|
+ "outputs": [],
|
|
|
+ "source": [
|
|
|
+ "myfig['plan']['angle'].changeAngle(angle)"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "cell_type": "code",
|
|
|
+ "execution_count": null,
|
|
|
+ "metadata": {},
|
|
|
+ "outputs": [],
|
|
|
+ "source": [
|
|
|
+ "myfig['plan']['angle']['arc'].arc_angle *180 /3.14"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "cell_type": "code",
|
|
|
+ "execution_count": null,
|
|
|
+ "metadata": {},
|
|
|
+ "outputs": [],
|
|
|
+ "source": [
|
|
|
+ "myfig['plan']['angle']['arc'].start_angle *180 /3.14"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "cell_type": "code",
|
|
|
+ "execution_count": null,
|
|
|
+ "metadata": {},
|
|
|
+ "outputs": [],
|
|
|
+ "source": [
|
|
|
+ " myfig['theta']"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "cell_type": "code",
|
|
|
+ "execution_count": null,
|
|
|
+ "metadata": {},
|
|
|
+ "outputs": [],
|
|
|
+ "source": [
|
|
|
+ "myfig['plan']['angle'].radius"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "cell_type": "code",
|
|
|
+ "execution_count": null,
|
|
|
+ "metadata": {},
|
|
|
+ "outputs": [],
|
|
|
+ "source": [
|
|
|
+ "myfig['plan']['angle'].center"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "cell_type": "code",
|
|
|
+ "execution_count": null,
|
|
|
+ "metadata": {},
|
|
|
+ "outputs": [],
|
|
|
+ "source": [
|
|
|
+ "myfig['plan']['angle'].resolution"
|
|
|
+ ]
|
|
|
+ },
|
|
|
{
|
|
|
"cell_type": "markdown",
|
|
|
"metadata": {},
|