Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

fixed issue with finding the angles of left-oriented spotlights

Ben Hambrechte1a5667ec07a
diff --git a/topics/light.py b/topics/light.py
index 67f1458c3..c58c3d79e 100644
--- a/topics/light.py
+++ b/topics/light.py
@@ -494,6 +494,8 @@ class Spotlight(VMobject):
lower_angle = np.min(viewing_angles)
upper_angle = np.max(viewing_angles)
+ if upper_angle - lower_angle > TAU/2:
+ lower_angle, upper_angle = upper_angle, lower_angle + TAU
return lower_angle, upper_angle
def viewing_rays(self,screen):
@@ -537,7 +539,6 @@ class Spotlight(VMobject):
new_submob = self.new_sector(submob.inner_radius,dr,lower_angle,upper_angle)
submob.points = new_submob.points
submob.set_fill(opacity = 10 * self.opacity_function(submob.outer_radius))
- print "new opacity:", self.opacity_function(submob.outer_radius)