擅长:python、mysql、java
<pre><code>import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
# DATA
L = 0.1 #m, length of arm of cross
t = L/2 #m, thickness
# VECTORS OF COORDINATES OF THE CROSS
X = np.array([L, t/2, t/2, -t/2, -t/2, -L, -L, -t/2, -t/2, t/2, t/2, L, L])
Y = np.array([t/2, t/2, L, L, t/2, t/2, -t/2, -t/2, -L, -L, -t/2, -t/2, t/2])
# PLOT
fig, ax = plt.subplots(figsize=(8,8))
ax.plot(X,Y,color='C1', linewidth=2.5)
ax.axis('equal')
circle1 = plt.Circle((L - t/2, 0), t/4, color='b', fill=False)
ax.add_patch(circle1)
circle2= plt.Circle((3/2*-t, 0), t/4, color='b', fill=False)
ax.add_patch(circle2)
circle3 = plt.Circle((0,L-t/2), t/4, color='b', fill=False)
ax.add_patch(circle3)
circle4= plt.Circle((0, 3/2*-t), t/4, color='b', fill=False)
ax.add_patch(circle4)
</code></pre>
<p><a href="https://i.stack.imgur.com/puUOn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/puUOn.png" alt="enter image description here"/></a></p>
<p>如果我没弄错你的问题,这似乎有效</p>