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:共享創意
姓名標示 相同方式分享
您可以自由:
  • 分享 – 複製、發佈和傳播本作品
  • 重新修改 – 創作演繹作品
惟需遵照下列條件:
  • 姓名標示 – 您必須指名出正確的製作者,和提供授權條款的連結,以及表示是否有對內容上做出變更。您可以用任何合理的方式來行動,但不得以任何方式表明授權條款是對您許可或是由您所使用。
  • 相同方式分享 – 如果您利用本素材進行再混合、轉換或創作,您必須基於如同原先的相同或兼容的條款,來分布您的貢獻成品。

說明

添加單行說明來描述出檔案所代表的內容

在此檔案描寫的項目

描繪內容

沒有維基數據項目的某些值

維基媒體使用者名稱 繁體中文 (已轉換拼寫):​Kilom691
作者姓名字串 繁體中文 (已轉換拼寫):​Kilom691

著作權狀態 繁體中文 (已轉換拼寫)

有著作權 繁體中文 (已轉換拼寫)

檔案來源 Chinese (Taiwan) (已轉換拼寫)

上傳者的原創作品 繁體中文 (已轉換拼寫)

檔案歷史

點選日期/時間以檢視該時間的檔案版本。

日期/時間縮⁠圖尺寸用戶備⁠註
目前2015年10月15日 (四) 19:12於 2015年10月15日 (四) 19:12 版本的縮圖705 × 286(10 KB)Kilom691User created page with UploadWizard

下列頁面有用到此檔案:

全域檔案使用狀況

以下其他 wiki 使用了這個檔案:

詮釋資料