|
|
@@ -94,7 +94,7 @@
|
|
|
"\n",
|
|
|
" B = point(a+L, 0)\n",
|
|
|
" A = point(a, tan(radians(theta))*L)\n",
|
|
|
- "\n",
|
|
|
+ " \n",
|
|
|
" wall = Wall(x=[A[0], B[0]], y=[A[1], B[1]], thickness=-0.25,\n",
|
|
|
" transparent=False)\n",
|
|
|
"\n",
|
|
|
@@ -115,6 +115,9 @@
|
|
|
" contact = point(x, y)\n",
|
|
|
" normal_vec = point(sin(radians(theta)), cos(radians(theta)))\n",
|
|
|
" tangent_vec = point(cos(radians(theta)), -sin(radians(theta)))\n",
|
|
|
+ " \n",
|
|
|
+ " length = Distance_wText(A+normal_vec*2.5,B+normal_vec*2.5, '$L$')\n",
|
|
|
+ " \n",
|
|
|
" c = contact + r*normal_vec\n",
|
|
|
" outer_wheel = Circle(c, r)\n",
|
|
|
" outer_wheel.set_linecolor('blue')\n",
|
|
|
@@ -134,11 +137,11 @@
|
|
|
" x_const.set_linestyle('dotted')\n",
|
|
|
" x_const.rotate(-theta, contact)\n",
|
|
|
" # or x_const = Line(contact-2*r*normal_vec, contact+4*r*normal_vec).set_linestyle('dotted')\n",
|
|
|
- " x_axis = Axis(start=contact+ 3*r*normal_vec, length=4*r,\n",
|
|
|
+ " x_axis = Axis(start=contact+ 3.5*r*normal_vec, length=4*r,\n",
|
|
|
" label='$x$', rotation_angle=-theta)\n",
|
|
|
"\n",
|
|
|
" body = Composition({'wheel': wheel, 'N': N, 'mg': mg})\n",
|
|
|
- " fixed = Composition({'angle': angle, 'inclined wall': wall,\n",
|
|
|
+ " fixed = Composition({'length': length, 'angle': angle, 'inclined wall': wall,\n",
|
|
|
" 'ground': ground,\n",
|
|
|
" 'x start': x_const, 'x axis': x_axis})\n",
|
|
|
"\n",
|
|
|
@@ -210,7 +213,7 @@
|
|
|
{
|
|
|
"data": {
|
|
|
"application/vnd.jupyter.widget-view+json": {
|
|
|
- "model_id": "d62ee3eb721b4dfb8e5ed6cb5f0b506b",
|
|
|
+ "model_id": "0a666eee05c24db584fc9920da91b8af",
|
|
|
"version_major": 2,
|
|
|
"version_minor": 0
|
|
|
},
|
|
|
@@ -264,54 +267,9 @@
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 14,
|
|
|
+ "execution_count": null,
|
|
|
"metadata": {},
|
|
|
- "outputs": [
|
|
|
- {
|
|
|
- "data": {
|
|
|
- "text/plain": [
|
|
|
- "<bound method Shape.show_hierarchy of {\n",
|
|
|
- "'body': {\n",
|
|
|
- " 'wheel': {\n",
|
|
|
- " 'outer': {\n",
|
|
|
- " 'arc': \"181 (x,y) coords linecolor='b' fillcolor='b' fillpattern=''\",},\n",
|
|
|
- " 'inner': {\n",
|
|
|
- " 'arc': \"181 (x,y) coords linecolor='b' fillcolor='w' fillpattern=''\",},},\n",
|
|
|
- " 'N': {\n",
|
|
|
- " 'arrow': {\n",
|
|
|
- " 'line': \"2 (x,y) coords arrow='->'\",},\n",
|
|
|
- " 'text': \"Text at (2.7875,1.94134)\",},\n",
|
|
|
- " 'mg': {\n",
|
|
|
- " 'arrow': {\n",
|
|
|
- " 'line': \"2 (x,y) coords linecolor='k' arrow='->'\",},\n",
|
|
|
- " 'text': \"Text at (4.5,1.48248)\",},},\n",
|
|
|
- "'fixed elements': {\n",
|
|
|
- " 'angle': {\n",
|
|
|
- " 'arc': {\n",
|
|
|
- " 'arc': \"181 (x,y) coords linecolor='k' linewidth=1\",},\n",
|
|
|
- " 'text': \"Text at (7.86074,0.841162)\",},\n",
|
|
|
- " 'inclined wall': {\n",
|
|
|
- " 'wall': \"4 (x,y) coords fillcolor='white' fillpattern='/'\",},\n",
|
|
|
- " 'ground': {\n",
|
|
|
- " 'line': \"2 (x,y) coords linecolor='k' linewidth=1 linestyle='dashed'\",},\n",
|
|
|
- " 'x start': {\n",
|
|
|
- " 'line': \"2 (x,y) coords linestyle='dotted'\",},\n",
|
|
|
- " 'x axis': {\n",
|
|
|
- " 'arrow': {\n",
|
|
|
- " 'line': {\n",
|
|
|
- " 'line': \"2 (x,y) coords\",},\n",
|
|
|
- " 'head left': {\n",
|
|
|
- " 'line': \"2 (x,y) coords linestyle='solid'\",},\n",
|
|
|
- " 'head right': {\n",
|
|
|
- " 'line': \"2 (x,y) coords linestyle='solid'\",},},\n",
|
|
|
- " 'label': \"Text at (9.25278,4.47286)\",},},}>"
|
|
|
- ]
|
|
|
- },
|
|
|
- "execution_count": 14,
|
|
|
- "metadata": {},
|
|
|
- "output_type": "execute_result"
|
|
|
- }
|
|
|
- ],
|
|
|
+ "outputs": [],
|
|
|
"source": [
|
|
|
"fig.show_hierarchy"
|
|
|
]
|