• 数学图形(2.3)绕在圆环上的曲线


    圆环面螺线

    #http://xuxzmail.blog.163.com/blog/static/25131916200976114621705/
    #Toroidal spiral
    
    vertices = 1000
    
    t = from 0 to (2*PI)
    
    r = 5
    n = 20
    
    x = (r+sin(20*t))*cos(t)
    y = (r+sin(20*t))*sin(t)
    z = cos(n*t)
    
    r = 10;
    x = x*r
    y = y*r
    z = z*r

    在前面讲了N叶结,当N值越大时,你会发现整个图形越像一个圆环.这一节就讲其他几种绕在圆环上的曲线.

    vertices = 12000
    t = from 0 to (64*PI)
    
    p = rand_int2(2, 32)
    q = rand_int2(2, 32)
    
    r = 2 + cos(q/p*t)
    
    x = r*sin(t)
    y = sin(q/p*t)
    z = r*cos(t)
    
    r = 0.5 + 0.5*sin(t)
    g = 0.5 + 0.5*y
    b = 0.5 + 0.5*cos(t)

    另一个圆环上的曲线

    #http://www.mathcurve.com/courbes3d/solenoidtoric/solenoidtoric.shtml
    
    vertices = 10000
    
    t = from 0 to (20*PI)
    
    n = rand2(0.5, 10)
    a = rand2(5, 10)
    b = rand2(1, 5)
    
    x = (a + b*cos(n*t))*cos(t)
    z = (a + b*cos(n*t))*sin(t)
    y = b*sin(n*t)

    knot(37)

    vertices = 10000
    t = from 0 to (6*PI)
    
    p = 3
    q = 7
    
    r = 2 + cos(q/p*t)
    
    x = r*sin(t)
    y = sin(q/p*t)
    z = r*cos(t)
    
    r = 0.5 + 0.5*sin(t)
    g = 0.5 + 0.5*y
    b = 0.5 + 0.5*cos(t)

  • 相关阅读:
    Spring配置数据源和注解开发
    spring 的配置介绍
    spring
    maven
    mybatis初始
    idea中配置xml不自动提示解决方案(eclipse配置XmlCatalog)
    JSON、AJAX
    ThreadLocal的使用
    Filter过滤器
    谷歌 kaptcha 图片验证码的使用
  • 原文地址:https://www.cnblogs.com/WhyEngine/p/3840009.html
Copyright © 2020-2023  润新知