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
Sectorclass by removing the redundant parametersinner_radiusandouter_radius, simplifying the constructor to accept only a singleradiusparameter. Theinner_radiusis 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
Sectorclass in Manim inherits parameters, includinginner_radiusandouter_radius, from theAnnularSectorclass.This makes the
Sectorclass exactly the same as theAnnularSectorclass. This is why the examples given in the Manim Documentation for theSectorclass are examples ofAnnularSector.Actually, the
Sectoris conceptually a special case ofAnnularSectorwhereinner_radiusshould always be0. This means that theSectorclass should only require a single parameter,radius, which is then directly passed toouter_radiusofAnnularSector.Links to added or changed documentation pages
Further Information and Comments
The examples provided in the Manim documentation for the
Sectorclass actually depict scenarios that are more representative of theAnnularSectorclass. 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
radiusis provided, withinner_radiusset to 0. It accurately represents a sector, demonstrating how the simplified constructor correctly models this geometric shape.Reviewer Checklist