Simplify Sector Class by Removing Redundant Parameters #3922
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview: What does this pull request change?
This pull request refines the
Sector
class by removing the redundant parametersinner_radius
andouter_radius
, simplifying the constructor to accept only a singleradius
parameter. Theinner_radius
is now automatically set to0
, reflecting the true geometric nature of a sector.Motivation and Explanation: Why and how do your changes improve the library?
Currently, the
Sector
class in Manim inherits parameters, includinginner_radius
andouter_radius
, from theAnnularSector
class.This makes the
Sector
class exactly the same as theAnnularSector
class. This is why the examples given in the Manim Documentation for theSector
class are examples ofAnnularSector
.Actually, the
Sector
is conceptually a special case ofAnnularSector
whereinner_radius
should always be0
. This means that theSector
class should only require a single parameter,radius
, which is then directly passed toouter_radius
ofAnnularSector
.Links to added or changed documentation pages
Further Information and Comments
The examples provided in the Manim documentation for the
Sector
class actually depict scenarios that are more representative of theAnnularSector
class. This highlights the confusion caused by the redundant parameters.Current Documentation Example of


Sector
:That example is similar to Example of
AnnularSector
:Correct Sector Representation

The following image depicts what a Sector should look like when only the
radius
is provided, withinner_radius
set to 0. It accurately represents a sector, demonstrating how the simplified constructor correctly models this geometric shape.Reviewer Checklist