mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Added complex_func_to_R3_func
This commit is contained in:
parent
49fe36b048
commit
03cc70b713
1 changed files with 4 additions and 0 deletions
|
@ -110,6 +110,10 @@ def R3_to_complex(point):
|
|||
return complex(*point[:2])
|
||||
|
||||
|
||||
def complex_func_to_R3_func(complex_func):
|
||||
return lambda p: complex_to_R3(complex_func(R3_to_complex(p)))
|
||||
|
||||
|
||||
def center_of_mass(points):
|
||||
points = [np.array(point).astype("float") for point in points]
|
||||
return sum(points) / len(points)
|
||||
|
|
Loading…
Add table
Reference in a new issue