mirror of
https://github.com/3b1b/manim.git
synced 2026-04-26 03:00:23 -04:00
Added complex_func_to_R3_func
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user