File:Voisinage tubulaire.svg

原始文件(SVG文件,尺寸为705 × 286像素,文件大小:10 KB)


摘要

描述
Français : Voisinage tubulaire de la courbe y=sin(x)
def main():
   f = sin(x)
   a = 0
   b = 2 * pi
   N = 1000

   # consider N points in the interval [a, b]
   X = [a + (b - a) / N * k for k in range(N + 1)]
   Y = [f(x=u) for u in X]

   ll = 3
   # length of lines perpendicular to the curve
   lls = 0.3
   #  smaller subsegments

   thin_line = 2
   thick_line = 4

   #  will draw lines perpendicular to the graph of Y=f(X) at
   #  points separted by length of 'spacing'
   spacing = 0.015
   M = floor(spacing * N)

   # colors
   red = [0.867, 0.06, 0.14]
   blue = list(vector([0, 129, 205]) / QQ(256))
   green = list(vector([0, 200, 70]) / QQ(256))

   G = Graphics()
   # plot the lines
   for k in range(1, N + 1):
          p = (k - 1) * M + 2
          if p >= N:
             break
          # the normal to the curve at (X(p), Y(p))
          Normal = vector([-(Y[p + 1] - Y[p - 1]), X[p + 1] - X[p - 1]])
          Normal = Normal / norm(Normal)
          G += line([(X[p] - lls * Normal[0], Y[p] - lls * Normal[1]),
                     (X[p] + lls * Normal[0], Y[p] + lls * Normal[1])],
                    color=red,
                    thickness=0.7 * thick_line)
   # plot the curve
   G += line2d(zip(X, Y), thickness=thick_line, color=blue)
   G.axes(False)
   G.set_aspect_ratio(1)
   return G
日期
来源 自己的作品
作者 Kilom691

许可协议

我,本作品著作权人,特此采用以下许可协议发表本作品:
w:zh:知识共享
署名 相同方式共享
本文件采用知识共享署名-相同方式共享 4.0 国际许可协议授权。
您可以自由地:
  • 共享 – 复制、发行并传播本作品
  • 修改 – 改编作品
惟须遵守下列条件:
  • 署名 – 您必须对作品进行署名,提供授权条款的链接,并说明是否对原始内容进行了更改。您可以用任何合理的方式来署名,但不得以任何方式表明许可人认可您或您的使用。
  • 相同方式共享 – 如果您再混合、转换或者基于本作品进行创作,您必须以与原先许可协议相同或相兼容的许可协议分发您贡献的作品。

说明

添加一行文字以描述该文件所表现的内容

此文件中描述的项目

描绘内容

文件来源 简体中文(已转写)

上传者的原创作品 简体中文(已转写)

文件历史

点击某个日期/时间查看对应时刻的文件。

日期/时间缩⁠略⁠图大小用户备注
当前2015年10月15日 (四) 19:122015年10月15日 (四) 19:12版本的缩略图705 × 286(10 KB)Kilom691User created page with UploadWizard

以下页面使用本文件:

全域文件用途

以下其他wiki使用此文件:

元数据