File:Color_complex_plot2.jpg
維基百科,自由的 encyclopedia
本预览的尺寸:600 × 600像素。 其他分辨率:240 × 240像素 | 480 × 480像素。
原始文件 (800 × 800像素,文件大小:202 KB,MIME类型:image/jpeg)
摘要
描述Color complex plot2.jpg |
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;
}
许可协议
我,本作品著作权人,特此采用以下许可协议发表本作品:
本文件采用知识共享署名-相同方式共享 3.0 未本地化版本许可协议授权。
- 您可以自由地:
- 共享 – 复制、发行并传播本作品
- 修改 – 改编作品
- 惟须遵守下列条件:
- 署名 – 您必须对作品进行署名,提供授权条款的链接,并说明是否对原始内容进行了更改。您可以用任何合理的方式来署名,但不得以任何方式表明许可人认可您或您的使用。
- 相同方式共享 – 如果您再混合、转换或者基于本作品进行创作,您必须以与原先许可协议相同或相兼容的许可协议分发您贡献的作品。
已授权您依据自由软件基金会发行的无固定段落及封面封底文字(Invariant Sections, Front-Cover Texts, and Back-Cover Texts)的GNU自由文件许可协议1.2版或任意后续版本的条款,复制、传播和/或修改本文件。该协议的副本请见“GNU Free Documentation License”。http://www.gnu.org/copyleft/fdl.htmlGFDLGNU Free Documentation Licensetruetrue |
您可以选择您需要的许可协议。
註解 InfoField | 該圖片含有註解:在維基媒體共享資源上查看註解 |
629
225
75
72
800
800
This is a double zero
457
579
61
65
800
800
A pole
此文件中描述的项目
描繪內容
某些值没有维基数据项目
27 3 2010
image/jpeg
207,059 字节
800 像素
800 像素
文件历史
点击某个日期/时间查看对应时刻的文件。
日期/时间 | 缩略图 | 大小 | 用户 | 备注 | |
---|---|---|---|---|---|
当前 | 2013年3月23日 (六) 22:58 | 800 × 800(202 KB) | Yourmomblah | Higher quality | |
2010年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使用此文件:
- ar.wikipedia.org上的用途
- de.wikipedia.org上的用途
- en.wikipedia.org上的用途
- fr.wikipedia.org上的用途
- pl.wikipedia.org上的用途