zoukankan      html  css  js  c++  java
  • love 的Python 表示

    """
    '17*x^2 - 16*|x|*y + 17*y^2 = 225'
    """
    
    import numpy as np
    import matplotlib.pyplot as plt
    
    X = np.arange(-5.0, 5.0, 0.1)
    Y = np.arange(-5.0, 5.0, 0.1)
    
    x, y = np.meshgrid(X, Y)
    f = 17 * x ** 2 - 16 * np.abs(x) * y + 17 * y ** 2 - 225
    
    fig = plt.figure()
    cs = plt.contour(x, y, f, 0, colors = 'r')
    plt.show()

    """
    '(x^2+y^2+y)^2 = x^2 + y^2'
    """
    import numpy as np
    import matplotlib.pyplot as plt
    
    X = np.arange(-2.0, 2.0, 0.05)
    Y = np.arange(-2.0, 2.0, 0.05)
    
    x, y = np.meshgrid(X, Y)
    f = (x ** 2 + y ** 2 + y) ** 2 - x ** 2 - y ** 2
    
    fig = plt.figure()
    cs = plt.contour(x, y, f, 0, colors = 'r')
    plt.show()
    

      

    """
    '8*x^2 - 9*|x|*y + 8*y^2 = 17'
    """
    import numpy as np
    import matplotlib.pyplot as plt
    
    X = np.arange(-2.5, 2.5, 0.05)
    Y = np.arange(-2.5, 2.5, 0.05)
    
    x, y = np.meshgrid(X, Y)
    f = 8 * x ** 2 - 9 * np.abs(x) * y + 8 * y ** 2 - 17
    fig = plt.figure()
    cs = plt.contour(x, y, f, 0, colors = 'r')
    plt.show()
    

      

    """
    '(x^2 + y^2 - 1)^3 - x^2*y^3 = 0'
    """
    import numpy as np
    import matplotlib.pyplot as plt
    import math
    X = np.arange(-2.0, 2.0, 0.05)
    Y = np.arange(-2.0, 2.0, 0.05)
    
    x, y = np.meshgrid(X, Y)
    
    f = (x ** 2 + y ** 2 - 1) ** 2 * (x ** 2 + y ** 2 - 1)- x ** 2 *  y ** 2 * y
    fig = plt.figure()
    cs = plt.contour(x, y, f, 0, colors = 'r')
    plt.show()
    

      

  • 相关阅读:
    poj 3662 Telephone Lines
    费马小定理证明
    CodeForces 1058 F Putting Boxes Together 树状数组,带权中位数
    共价大爷游长沙 lct 维护子树信息
    牛客暑假多校 F RIKKA with Line Graph
    牛客暑假多校 H Prefix sum
    HDU-6437 Videos
    模板汇总——AC自动机
    模板汇总——逆元
    模板汇总——LCT
  • 原文地址:https://www.cnblogs.com/lihuibng/p/2583615.html
Copyright © 2011-2022 走看看