mirror of
https://github.com/3b1b/manim.git
synced 2025-07-30 13:34:19 +08:00
spelling change, spacial to spatial
This commit is contained in:
@ -51,8 +51,8 @@ class Animation(object):
|
|||||||
(abs(points[:,1]) < self.restricted_height)
|
(abs(points[:,1]) < self.restricted_height)
|
||||||
for filter_function in self.filter_functions:
|
for filter_function in self.filter_functions:
|
||||||
admissibles *= ~filter_function(points)
|
admissibles *= ~filter_function(points)
|
||||||
if any(self.spacial_center):
|
if any(self.spatial_center):
|
||||||
points += self.spacial_center
|
points += self.spatial_center
|
||||||
#Filter out points pushed off the edge
|
#Filter out points pushed off the edge
|
||||||
admissibles *= (abs(points[:,0]) < SPACE_WIDTH) * \
|
admissibles *= (abs(points[:,0]) < SPACE_WIDTH) * \
|
||||||
(abs(points[:,1]) < SPACE_HEIGHT)
|
(abs(points[:,1]) < SPACE_HEIGHT)
|
||||||
@ -82,7 +82,7 @@ class Animation(object):
|
|||||||
return self
|
return self
|
||||||
|
|
||||||
def shift(self, vector):
|
def shift(self, vector):
|
||||||
self.spacial_center += vector
|
self.spatial_center += vector
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def set_run_time(self, time):
|
def set_run_time(self, time):
|
||||||
|
@ -5,7 +5,7 @@ import copy
|
|||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
from animation import Animation
|
from animation import Animation
|
||||||
from mobject import Mobject, Point, Grid
|
from mobject import Mobject, Point
|
||||||
from constants import *
|
from constants import *
|
||||||
from helpers import *
|
from helpers import *
|
||||||
|
|
||||||
|
@ -18,13 +18,13 @@ class NumberLineScene(Scene):
|
|||||||
self.add(self.number_line, *self.number_mobs)
|
self.add(self.number_line, *self.number_mobs)
|
||||||
|
|
||||||
def zoom_in_on(self, number, zoom_factor, run_time = 2.0):
|
def zoom_in_on(self, number, zoom_factor, run_time = 2.0):
|
||||||
unit_length_to_spacial_width = self.number_line.unit_length_to_spacial_width*zoom_factor
|
unit_length_to_spatial_width = self.number_line.unit_length_to_spatial_width*zoom_factor
|
||||||
radius = SPACE_WIDTH/unit_length_to_spacial_width
|
radius = SPACE_WIDTH/unit_length_to_spatial_width
|
||||||
tick_frequency = 10**(np.floor(np.log10(radius)))
|
tick_frequency = 10**(np.floor(np.log10(radius)))
|
||||||
left_tick = tick_frequency*(np.ceil((number-radius)/tick_frequency))
|
left_tick = tick_frequency*(np.ceil((number-radius)/tick_frequency))
|
||||||
new_number_line = NumberLine(
|
new_number_line = NumberLine(
|
||||||
numerical_radius = radius,
|
numerical_radius = radius,
|
||||||
unit_length_to_spacial_width = unit_length_to_spacial_width,
|
unit_length_to_spatial_width = unit_length_to_spatial_width,
|
||||||
tick_frequency = tick_frequency,
|
tick_frequency = tick_frequency,
|
||||||
leftmost_tick = left_tick,
|
leftmost_tick = left_tick,
|
||||||
number_at_center = number
|
number_at_center = number
|
||||||
|
@ -234,13 +234,13 @@ class IntervalScene(NumberLineScene):
|
|||||||
return intervals, lines
|
return intervals, lines
|
||||||
|
|
||||||
def add_open_interval(self, num, width, color = None, run_time = 0):
|
def add_open_interval(self, num, width, color = None, run_time = 0):
|
||||||
spacial_width = width*self.number_line.unit_length_to_spacial_width
|
spatial_width = width*self.number_line.unit_length_to_spatial_width
|
||||||
center_point = self.number_line.number_to_point(num)
|
center_point = self.number_line.number_to_point(num)
|
||||||
open_interval = OpenInterval(center_point, spacial_width)
|
open_interval = OpenInterval(center_point, spatial_width)
|
||||||
color = color or "yellow"
|
color = color or "yellow"
|
||||||
interval_line = Line(
|
interval_line = Line(
|
||||||
center_point+spacial_width*LEFT/2,
|
center_point+spatial_width*LEFT/2,
|
||||||
center_point+spacial_width*RIGHT/2
|
center_point+spatial_width*RIGHT/2
|
||||||
)
|
)
|
||||||
interval_line.do_in_place(interval_line.sort_points, np.linalg.norm)
|
interval_line.do_in_place(interval_line.sort_points, np.linalg.norm)
|
||||||
interval_line.highlight(color)
|
interval_line.highlight(color)
|
||||||
|
Reference in New Issue
Block a user