English: ```python
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.animation as animation
duration = 5
total_frames = duration * 24
frame_interval = 1000 / 24
x = np.linspace(-2, 2, 100)
y = np.linspace(-2, 2, 100)
x, y = np.meshgrid(x, y)
z_surface = x**2 - y**2
- Function to update the plot for animation
def update(num, ax, fig):
ax.clear()
h = np.linspace(-1, 1, total_frames)[num]
# Plot the surface
ax.plot_surface(x, y, z_surface, color='blue', alpha=0.7)
# Plot the plane
ax.plot_surface(x, y, np.full_like(z_surface, h), color='green', alpha=0.5)
# Calculate and plot intersections
intersection_y = np.linspace(-2, 2, 100)
intersection_x1 = np.sqrt(intersection_y**2 + h)
intersection_x2 = -np.sqrt(intersection_y**2 + h)
ax.plot(intersection_x1, intersection_y, h, color='red')
ax.plot(intersection_x2, intersection_y, h, color='red')
# Remove the x, y, z axes and grid
ax.set_axis_off()
- Create figure and axis
fig = plt.figure(figsize=(10, 10))
ax = fig.add_subplot(111, projection='3d')
ani = animation.FuncAnimation(fig, update, frames=total_frames, fargs=(ax, fig), interval=frame_interval)
from matplotlib.animation import FFMpegWriter
writer = FFMpegWriter(fps=24, codec='libvpx', extra_args=['-vcodec', 'vp9'])
ani.save('dupin_indicatrix.webm', writer=writer)
```