Чтобы иметь дугу / окружность в плоскости YZ, как показано, уравнение довольно простое:
where y0 and z0 are the center of the circle and R the radius.
A solution of this equation is:
where spans to have the full circle.
You can then simply restrict the domain of to have only an arc and not a circle:
import numpy as np
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
r = 5.
y0 = r # To have the tangent at y=0
z0 = 0.
# Theta varies only between pi/2 and 3pi/2. to have a half-circle
theta = np.linspace(np.pi/2., 3*np.pi/2., 201)
x = np.zeros_like(theta) # x=0
y = r*np.cos(theta) + y0 # y - y0 = r*cos(theta)
z = r*np.sin(theta) + z0 # z - z0 = r*sin(theta)
ax.plot(x, y, z)
ax.plot((0, 0), (0, 0), (-r, r), '-r', label='z-axis')
ax.set_xlabel('X-Axis')
ax.set_ylabel('Y-Axis')
ax.set_zlabel('Z-Axis')
ax.legend()
plt.show()
Чтобы изменить угол или дугу, есть несколько способов. Более простым, на мой взгляд, является построение дуги эллипса (вместо круга) путем установки различных радиусов для y и z:
x = np.zeros_like(theta) # x=0
y = a*np.cos(theta) + y0 # y - y0 = a*cos(theta)
z = b*np.sin(theta) + z0 # z - z0 = b*sin(theta)