Skip to content

Commit a0e841f

Browse files
author
Samarth Naik
committed
refactor: rename Torus field 'r' to 'minor_radius' for clarity
1 parent 3e8f41c commit a0e841f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

manim/mobject/three_d/three_dimensions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,7 @@ def __init__(
12541254
resolution = resolution if resolution is not None else res_value
12551255

12561256
self.R = major_radius
1257-
self.r = minor_radius
1257+
self.minor_radius = minor_radius
12581258
super().__init__(
12591259
self.func,
12601260
u_range=u_range,
@@ -1271,5 +1271,5 @@ def func(self, u: float, v: float) -> np.ndarray:
12711271
:class:`numpy.ndarray`
12721272
The z values defining the :class:`Torus`.
12731273
"""
1274-
P = np.array([np.cos(u), np.sin(u), 0])
1275-
return (self.R - self.r * np.cos(v)) * P - self.r * np.sin(v) * OUT
1274+
P = np.array([np.cos(u), np.sin(u), 0])
1275+
return (self.R - self.minor_radius * np.cos(v)) * P - self.minor_radius * np.sin(v) * OUT

0 commit comments

Comments
 (0)