跳转到内容

File:Color complex plot2.jpg

页面内容不支持其他语言。
这个文件来自维基共享资源
维基百科,自由的百科全书

原始文件 (800 × 800像素,文件大小:202 KB,MIME类型:image/jpeg


摘要

描述
English: Colour plot of complex function (x² - 1) * (x-2-I)² / (x² + 2 + 2I), hue represents the argument, sat and value represents the modulo. Contours distinguish intervals [e^i, e^(i+1)] where i=0,1,2... Shadow is on the higher modulus side.

Zeros have pin-wheel of colours, one cycle of the colour wheel for simple zero, two cycles for double zero etc.

Contours are approaching poles with the shadowed side, and the colours cycle in reverse order around a pole.
日期
来源 自己的作品
作者 Jan Winnicki
其他版本

Source code

This is the source code used for image generation. It is a slightly modified version of File:Color complex plot.jpg. In this version the real axis is directing right. And contours bring more information.

#include <complex>
#include <fstream>
 
using namespace std;

void SetHSV(double h, double s, double v, unsigned char color[3]) {
  double r=0, g=0, b=0;
  if(s==0)
    r = g = b = v;
  else {
    h /= 60;
    int i = floor(h);
    double f = h - i;
    double p = v*(1-s);
    double q = v*(1-s*f);
    double t = v*(1-s*(1-f));
    
    switch(i){
      case 0: r=v; g=t; b=p; break;
      case 1: r=q; g=v; b=p; break;
      case 2: r=p; g=v; b=t; break;
      case 3: r=p; g=q; b=v; break;
      case 4: r=t; g=p; b=v; break;
      case 5: r=v; g=p; b=q; break;
    }
  }
  int c;
  c = int(256*r); if(c>255) c = 255; color[0] = c;
  c = int(256*g); if(c>255) c = 255; color[1] = c;
  c = int(256*b); if(c>255) c = 255; color[2] = c;
}

complex<double> fun(complex<double>& c ){
  const complex<double> i(0., 1.);
  return (pow(c,2) - 1.) * pow(c -2. -i, 2) / (pow(c, 2) + 2. + 2. * i);
}
 
int main(){
  const int dimx = 800; const int dimy = 800;
  const double rmi = -3; const double rma =  3;
  const double imi = -3; const double ima =  3;

  ofstream f("complex.ppm", ios::binary);
  f << "P6" << endl
    << dimx << " " << dimy << endl
    << "255" << endl;

  for(int j=0; j < dimy; ++j){
    double im = ima - (ima -imi) *j /(dimy -1);
    for(int i=0; i < dimx; ++i){    
      double re = rmi +(rma -rmi) *i /(dimx -1);
      complex<double> c(re, im);
      complex<double> v = fun(c); 
      double a = arg(v)*180/M_PI;
      if(a < 0) a += 360;
      
      double m = abs(v);
      double ranges;
      double rangee = 1;

      while(m>rangee){
          ranges = rangee;
          rangee *= M_E;
      }

      double k   = (m-ranges)/(rangee-ranges);
      double sat = k < 0.5 ? 1-2.8*k : 2.8*k-1.1;
      if(sat < 0.3) sat = 0.3;
      else if(sat > 1) sat = 1;

      double val = k < 0.5 ? 1.4-1.6*k : 1.6*k-0.6;
      if(val < 0.6) val = 0.6;
      else if(val > 1) val = 1;

      unsigned char color[3];
      SetHSV(a,sat,val,color);
      f.write(color,3);
    }
  }
  return 0;
}

许可协议

我,本作品著作权人,特此采用以下许可协议发表本作品:
w:zh:知识共享
署名 相同方式共享
您可以自由地:
  • 共享 – 复制、发行并传播本作品
  • 修改 – 改编作品
惟须遵守下列条件:
  • 署名 – 您必须对作品进行署名,提供授权条款的链接,并说明是否对原始内容进行了更改。您可以用任何合理的方式来署名,但不得以任何方式表明许可人认可您或您的使用。
  • 相同方式共享 – 如果您再混合、转换或者基于本作品进行创作,您必须以与原先许可协议相同或相兼容的许可协议分发您贡献的作品。
GNU head 已授权您依据自由软件基金会发行的无固定段落及封面封底文字(Invariant Sections, Front-Cover Texts, and Back-Cover Texts)的GNU自由文件许可协议1.2版或任意后续版本的条款,复制、传播和/或修改本文件。该协议的副本请见“GNU Free Documentation License”。
您可以选择您需要的许可协议。
注解
InfoField
该图片含有注解:在维基媒体共享资源上查看注解

说明

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

此文件中描述的项目

描绘内容

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

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

image/jpeg

校验和 简体中文(已转写)

a8d04a91ab03b58d2ace93c2b2f769cf6b0ccbe7

断定方法:​SHA-1 简体中文(已转写)

数据大小 简体中文(已转写)

207,059 字节

800 像素

800 像素

文件历史

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

日期/时间缩⁠略⁠图大小用户备注
当前2013年3月23日 (六) 22:582013年3月23日 (六) 22:58版本的缩略图800 × 800(202 KB)YourmomblahHigher quality
2010年3月27日 (六) 02:022010年3月27日 (六) 02:02版本的缩略图800 × 800(234 KB)Jan Winnicki{{Information |Description={{en|1=Colour plot of complex function (x² - 1) * (x² - I)² / (x² + 2 + 2I), hue represents the argument, sat and value represents the modulo. Contours distinguish intervals [e^i, e^(i+1)] where i=0,1,2... Shadow is on the h

没有页面使用本文件。

全域文件用途

以下其他wiki使用此文件: