File:Surface normals.svg

From testwiki
Jump to navigation Jump to search
    Original file (SVG file, nominally 575 × 449 pixels, file size: 237 KB)

    This file is from Wikimedia Commons and may be used by other projects. The description on its file description page there is shown below.

    Summary

    Description
    English: Normal vectors for the surface xe−x2−y2.
    Español: Vectores normales a la superficie xe−x2−y2.
    Date
    Source Own work
    Author Nicoguaro
    SVG development
    InfoField
     The SVG code is valid.
     This plot was created with Matplotlib.
    Source code
    InfoField

    Python code

    import numpy as np
    import matplotlib.pyplot as plt
    from mpl_toolkits.mplot3d import Axes3D
    
    x, y = np.mgrid[-1:1:31j, -1:1:31j]
    xs, ys = np.mgrid[-1:1:9j, -1:1:9j]
    
    z = x*np.exp(-x**2 - y**2)
    zs = xs*np.exp(-xs**2 - ys**2)
    u = -(1 - 2*xs**2)*np.exp(-xs**2 - ys**2)
    v = 2*ys*zs
    w = np.ones_like(xs)
    
    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d')
    ax.view_init(azim=145, elev=45)
    ax.plot_surface(x, y, z, rstride=1, cstride=1, cmap="summer", lw=0.3,
                    edgecolors="k")
    ax.quiver(xs, ys, zs, u, v, w, colors='k', pivot='tail', length=0.3)
    plt.axis("off")
    plt.savefig("Surface normals.svg", bbox_inches="tight", transparent=True)
    plt.show()
    

    Licensing

    I, the copyright holder of this work, hereby publish it under the following license:
    w:en:Creative Commons
    attribution
    This file is licensed under the Creative Commons Attribution 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.

    Captions

    Add a one-line explanation of what this file represents

    Items portrayed in this file

    depicts

    11 February 2016

    File history

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

    Date/TimeThumbnailDimensionsUserComment
    current02:16, 12 February 2016Thumbnail for version as of 02:16, 12 February 2016575 × 449 (237 KB)wikimediacommons>NicoguaroUser created page with UploadWizard

    There are no pages that use this file.