原始檔案(SVG 檔案,表面大小:512 × 512 像素,檔案大小:2 KB)


摘要

描述
English: The Swastika curve plotted using 79 data points in first quadrant and repeated using symmetry.
日期
來源 自己的作品
作者 Krishnavedala
其他版本 Image:Swastica_curve3.png
SVG開發
InfoField
 
SVG檔案的原始碼通過W3C驗證
 
向量圖形使用文字編輯器創作v.

Source Code

#include    <stdio.h>
#include    <stdlib.h>
#include    <math.h>
#include    <unistd.h>
#include    <plplot/plplot.h>

long unsigned int NUM_PTS = 10000;
PLINT XMAX = 2;
PLINT YMAX = 2;

void generateCurve(PLFLT *x, PLFLT *y)
{
    int i = 0;
    double r, theta=0.f;
    float step = 2*PI/NUM_PTS;
    float s, c;
   
    while(theta < 2*PI)
    {
        s = sin(theta);        c = cos(theta);
        r = sqrt(s * c / (pow(s,4) - pow(c,4)));
        x[i] = (PLFLT) (r * cos(theta));
        y[i] = (PLFLT) (r * sin(theta));
        /*
        x[i] = (PLFLT) cos(theta) * sqrt(-1/sin(theta*4)) * modulus(sin(2*theta));
        y[i] = (PLFLT) sin(theta) * sqrt(-1/sin(theta*4)) * modulus(sin(2*theta));
        */
        theta += (double) step;
        i++;
    }
}

int main(void)
{
    PLFLT *X = NULL, *Y = NULL;
    plscolbg(255, 255, 255);
    plsdev("wxwidget");
    plinit();   // initialize plotting library
    plscol0(15, 0, 0, 0);
    plcol(15);
    plenv(-XMAX, XMAX, -YMAX, YMAX, 1, -2);
    plbox( "abcstn", 0, 0, "anbcst", 0, 0);
    pllab("X", "Y", "Swastika Curve");
    X = (PLFLT*) malloc(NUM_PTS * sizeof(PLFLT*));
    Y = (PLFLT*) malloc(NUM_PTS * sizeof(PLFLT*));
    if(X == NULL &#x7C;&#x7C; Y == NULL) 
    {
        perror("Unable to allocate memory!!");
        free(X);   free(Y);     exit(1);
    }
    generateCurve(X, Y);
    plline(NUM_PTS, X, Y);
    plend();    // close the plotting library
    { free(X);   free(Y); }
    return 0;
}

授權條款

我,本作品的著作權持有者,決定用以下授權條款發佈本作品:
w:zh:共享創意
姓名標示 相同方式分享
您可以自由:
  • 分享 – 複製、發佈和傳播本作品
  • 重新修改 – 創作演繹作品
惟需遵照下列條件:
  • 姓名標示 – 您必須指名出正確的製作者,和提供授權條款的連結,以及表示是否有對內容上做出變更。您可以用任何合理的方式來行動,但不得以任何方式表明授權條款是對您許可或是由您所使用。
  • 相同方式分享 – 如果您利用本素材進行再混合、轉換或創作,您必須基於如同原先的相同或兼容的條款,來分布您的貢獻成品。
GNU head 已授權您依據自由軟體基金會發行的無固定段落、封面文字和封底文字GNU自由文件授權條款1.2版或任意後續版本,對本檔進行複製、傳播和/或修改。該協議的副本列在GNU自由文件授權條款中。
您可以選擇您需要的授權條款。

說明

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

在此檔案描寫的項目

描繪內容

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

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

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

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

檔案歷史

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

日期/時間縮⁠圖尺寸用戶備⁠註
目前2015年4月19日 (日) 18:25於 2015年4月19日 (日) 18:25 版本的縮圖512 × 512(2 KB)Krishnavedalasimplified drawing
2010年11月24日 (三) 15:01於 2010年11月24日 (三) 15:01 版本的縮圖645 × 645(86 KB)AnonMooscosmetic changes to be more suitable for use in articles.
2010年11月24日 (三) 13:53於 2010年11月24日 (三) 13:53 版本的縮圖900 × 675(104 KB)KrishnavedalaChanged the plot color to black. == Source Code == #include <stdio.h> #include <stdlib.h> #include <math.h> #include <unistd.h> #include <plplot/plplot.h> long unsigned int NUM_PTS = 10000; PLINT XMAX = 2; PLINT YMAX = 2; void generateCu
2010年11月24日 (三) 13:33於 2010年11月24日 (三) 13:33 版本的縮圖900 × 675(104 KB)Krishnavedala{{Information |Description={{en|1=The Swastika curve plotted and saved using PLplot library.}} |Source={{own}} |Author=Krishnavedala |Date=2010-11-24 |Permission= |other_versions=[[:Image:Sw

下列頁面有用到此檔案:

全域檔案使用狀況

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

詮釋資料