Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Fixed example in gallery to allow a two-dimensional mean (#1845)

Harivinay70041f51ae52
diff --git a/docs/source/examples.rst b/docs/source/examples.rst
index 6b97f723e..b0ff789f0 100644
--- a/docs/source/examples.rst
+++ b/docs/source/examples.rst
@@ -579,9 +579,9 @@ Special Camera Settings
def param_gauss(u, v):
x = u
y = v
- d = np.sqrt(x * x + y * y)
- sigma, mu = 0.4, 0.0
- z = np.exp(-((d - mu) ** 2 / (2.0 * sigma ** 2)))
+ sigma, mu = 0.4, [0.0, 0.0]
+ d = np.linalg.norm(np.array([x - mu[0], y - mu[1]]))
+ z = np.exp(-(d ** 2 / (2.0 * sigma ** 2)))
return np.array([x, y, z])
gauss_plane = ParametricSurface(