原始文件(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的源代码为有效代码.
 
矢量图形由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 已授权您依据自由软件基金会发行的无固定段落及封面封底文字(Invariant Sections, Front-Cover Texts, and Back-Cover Texts)的GNU自由文件许可协议1.2版或任意后续版本的条款,复制、传播和/或修改本文件。该协议的副本请见“GNU Free Documentation License”。
您可以选择您需要的许可协议。

说明

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

此文件中描述的项目

描绘内容

版权状态 简体中文(已转写)

版权所有 简体中文(已转写)

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

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

文件历史

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

日期/时间缩⁠略⁠图大小用户备注
当前2015年4月19日 (日) 18:252015年4月19日 (日) 18:25版本的缩略图512 × 512(2 KB)Krishnavedalasimplified drawing
2010年11月24日 (三) 15:012010年11月24日 (三) 15:01版本的缩略图645 × 645(86 KB)AnonMooscosmetic changes to be more suitable for use in articles.
2010年11月24日 (三) 13:532010年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:332010年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使用此文件:

元数据