zoukankan      html  css  js  c++  java
  • 数学图形(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)

  • 相关阅读:
    dnsever 邮件记录
    用于显示上个月和下个月_PHP
    JSON学习
    ASP生成新会员编号
    godaddy_关于产品退款
    Switch Case语句中多个值匹配同一个代码块的写法
    网闸与防火墙的比较
    bench.sh 跑分测速
    Kcptun加速SS
    linux 安全狗
  • 原文地址:https://www.cnblogs.com/WhyEngine/p/3840009.html
Copyright © 2011-2022 走看看