Original file (SVG file, nominally 800 × 800 pixels, file size: 805 bytes)
This is a file from the Wikimedia Commons. Information from its description page there is shown below. Commons is a freely licensed media file repository. You can help. |
DescriptionDemipenteract graph ortho.svg |
English: Othographic projection of Demipenteract (edge gragh)
|
Date | |
Source | Own work |
Author | Claudio Rocchini |
static int nbit( int x ) {
int n = 0;
while(x) { if(x&1) ++n; x >>= 1; }
return n;
}
void main() {
const int D = 5; const int NV = 16; const int NE = 80;
double v[NV][D]; int e[NE][2];
double px[NV]; double py[NV];
// Magic numbers
const double x1 = -.1464466094; const double y1 = .3535533906;
const double x2 = -.1464466094; const double y2 = -.3535533906;
const double x3 = -.3535533906; const double y3 = .1464466094;
const double y4 = -.1464466094; const double x4 = -.3535533906;
const double x5 = 0; const double y5 = 0;
const double PX[D] = {x1,x2,x3,x4,x5};
const double PY[D] = {y1,y2,y3,y4,y5};
int i,j,k,l;
for(k=0,i=0;i<(1<<D);++i) if(nbit(i)%2==0){
for(j=0;j<D;++j) v[k][j] = (i>>j)&1 ? 1.0 : -1.0;
++k;
}
assert(k==NV);
for(k=0,i=0;i<NV-1;++i) for(j=i+1;j<NV;++j) {
double d = 0;
for(l=0;l<D;++l) { double t = v[i][l]-v[j][l]; d += t*t; }
if(d==8) { e[k][0]=i; e[k][1]=j; ++k; }
}
for(i=0;i<NV;++i){
px[i] = 0; for(l=0;l<D;++l) px[i] += v[i][l]*PX[l];
py[i] = 0; for(l=0;l<D;++l) py[i] += v[i][l]*PY[l];
}
const double SX = 800; const double SY = 800;
const double B = 64; const double R = 12;
const double sca = std::min((SX-2*B)/2,(SY-2*B)/2);
for(i=0;i<NV;++i) { px[i] = B+(px[i]+1)*sca; py[i] = B+(py[i]+1)*sca; }
FILE * fp = fopen("c:\\temp\\Demipenteract_Graph2.svg","w");
fprintf(fp,
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
"<svg\n"
"xmlns:svg=\"http://www.w3.org/2000/svg\"\n"
"xmlns=\"http://www.w3.org/2000/svg\"\n"
"version=\"1.0\"\n"
"width=\"%g\"\n" "height=\"%g\"\n"
"id=\"Demipenteract_Graph2\">\n"
,SX,SY
);
fprintf(fp,"<g style=\"stroke:#000000;stroke-width:3;stroke-opacity:1.0;\">\n");
for(i=0;i<NE;++i)
fprintf(fp,
"<line x1=\"%5.1lf\" y1=\"%5.1lf\" x2=\"%5.1lf\" y2=\"%5.1lf\"/>\n"
,px[e[i][0]],py[e[i][0]], px[e[i][1]],py[e[i][1]]
);
fprintf(fp,"</g>\n");
fprintf(fp,"<g style=\"stroke:#000000;stroke-width:2;fill:#0000E0\">\n");
for(i=0;i<NV;++i)
fprintf(fp,"<circle cx=\"%5.1lf\" cy=\"%5.1lf\" r=\"%5.1lf\"/>\n",px[i],py[i],R);
fprintf(fp,"</g>\n");
fprintf(fp,"</svg>\n");
fclose(fp);
}
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.http://www.gnu.org/copyleft/fdl.htmlGFDLGNU Free Documentation Licensetruetrue |
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 03:17, 11 October 2021 | 800 × 800 (805 bytes) | Andreasl01 | Simplified code | |
21:34, 12 September 2008 | 800 × 800 (5 KB) | Tomruen | try red dots | ||
11:40, 28 July 2008 | 800 × 800 (5 KB) | Rocchini | {{Information |Description={{en|1=Othographic projection of Demipenteract (edge gragh)}} |Source=Opera creata dall'uploader (own work by uploader) |Author=Claudio Rocchini |Date=2008-07-28 |Permission= |other_versions= }} {{ImageUpload| |
This file contains additional information, probably added from the digital camera or scanner used to create or digitize it.
If the file has been modified from its original state, some details may not fully reflect the modified file.
Width | 800 |
---|---|
Height | 800 |