mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Clean up Arc init
This commit is contained in:
parent
b967c04c2c
commit
dba70ceded
1 changed files with 3 additions and 8 deletions
|
@ -226,14 +226,9 @@ class Arc(TipableVMobject):
|
||||||
start_angle: float = 0,
|
start_angle: float = 0,
|
||||||
n_components: int = 8
|
n_components: int = 8
|
||||||
) -> Vect3:
|
) -> Vect3:
|
||||||
samples = np.array([
|
n_curves = 2 * n_components + 1
|
||||||
[np.cos(a), np.sin(a), 0]
|
angles = np.linspace(start_angle, start_angle + angle, n_curves)
|
||||||
for a in np.linspace(
|
samples = np.array([np.cos(angles), np.sin(angles), np.zeros(n_curves)]).T
|
||||||
start_angle,
|
|
||||||
start_angle + angle,
|
|
||||||
2 * n_components + 1,
|
|
||||||
)
|
|
||||||
])
|
|
||||||
theta = angle / n_components
|
theta = angle / n_components
|
||||||
samples[1::2] /= np.cos(theta / 2)
|
samples[1::2] /= np.cos(theta / 2)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue