mirror of
https://github.com/3b1b/manim.git
synced 2025-08-19 13:01:00 +00:00
Synced the display of cComplexPlanes to the way NumberPlanes display. However, the code should further be merged at some point
This commit is contained in:
parent
265986c3f3
commit
eb09b57356
1 changed files with 4 additions and 4 deletions
|
@ -170,7 +170,6 @@ class ComplexPlane(NumberPlane):
|
|||
"unit_size" : 1,
|
||||
"line_frequency" : 1,
|
||||
"faded_line_frequency" : 0.5,
|
||||
"number_scale_factor" : 0.5,
|
||||
}
|
||||
def __init__(self, **kwargs):
|
||||
digest_config(self, kwargs)
|
||||
|
@ -204,6 +203,8 @@ class ComplexPlane(NumberPlane):
|
|||
for y in range(-int(self.y_radius), int(self.y_radius)+1)
|
||||
]
|
||||
for number in numbers:
|
||||
if number == complex(0, 0):
|
||||
continue
|
||||
point = self.number_to_point(number)
|
||||
num_str = str(number).replace("j", "i")
|
||||
if num_str.startswith("0"):
|
||||
|
@ -212,9 +213,8 @@ class ComplexPlane(NumberPlane):
|
|||
num_str = num_str.replace("1", "")
|
||||
num_mob = TexMobject(num_str)
|
||||
num_mob.add_background_rectangle()
|
||||
num_mob.scale(self.number_scale_factor)
|
||||
vect = DOWN + LEFT
|
||||
num_mob.next_to(point, vect, SMALL_BUFF)
|
||||
num_mob.scale_to_fit_height(self.written_coordinate_height)
|
||||
num_mob.next_to(point, DOWN+LEFT, SMALL_BUFF)
|
||||
result.add(num_mob)
|
||||
return result
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue