File:Dupin indicatrix.webm

The media handler extension for this file format is missing. Advanced media features may not work unless the file is viewed at Wikimedia Commons.

Original file(file size: 235 KB, MIME type: video/webm)

Summary

Description
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

  1. 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()
  1. 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)

```
Date
Source Own work
Author Cosmia Nebula

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

17 November 2023

video/webm

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current18:05, 17 November 2023Thumbnail for version as of 18:05, 17 November 2023 (235 KB)wikimediacommons>Cosmia NebulaUploaded while editing "Dupin indicatrix" on en.wikipedia.org

The following page uses this file: