Image:Gray configuration.svg

From Wikipedia, the free encyclopedia

Gray_configuration.svg (SVG file, nominally 368 × 374 pixels, file size: 13 KB)

Wikimedia Commons logo This is a file from the Wikimedia Commons. The description on its description page there is shown below.
Commons is a freely licensed media file repository. You can help.

[edit] Summary

Description

The Gray configuration, 27 points and 27 lines meeting three lines to a point and three points to a line, drawn as a perspective view of a three-dimensional 3x3x3 grid.

Source

self-made

Date

April 12, 2008

Author

David Eppstein

Permission
(Reusing this image)

see below


[edit] Source code

This image was created as a pdf file by the following Python code, then rescaled and converted to SVG.

from pyx import canvas,path,color
from math import sqrt,tan,asin
 
pov = (-20,6,5)
x,y,z = 2,1,0
radius = 0.05
scale = 10.0
vertexColor = [color.rgb.red]
edgeColor = [color.rgb.black]
 
def distance(p,q):
    return sqrt(sum([(p[i]-q[i])**2 for i in (x,y,z)]))
 
def perspective(loc):
    dz = loc[z]-pov[z]
    return (loc[x]-pov[x])*scale/dz, (loc[y]-pov[y])*scale/dz
 
def vertex(p):
    lx,ly = perspective(p)
    prad = scale*1.1*tan(asin(radius/(distance(p,pov))))
    c.fill(path.circle(lx,ly,prad),vertexColor)
 
def edge(p,q):
    lx1,ly1 = perspective(p)
    lx2,ly2 = perspective(q)
    c.stroke(path.line(lx1,ly1,lx2,ly2),edgeColor)
 
c = canvas.canvas()
 
for i in range(3):
    for j in range(3):
        edge((i,j,0),(i,j,2))
        edge((i,0,j),(i,2,j))
        edge((0,i,j),(2,i,j))
 
for i in range(3):
    for j in range(3):
        for k in range(3):
            vertex((i,j,k))
 
c.writePDFfile("Gray configuration")

[edit] Licensing

Public domain I, the copyright holder of this work, hereby release it into the public domain. This applies worldwide.

In case this is not legally possible:
I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law.


Afrikaans | Alemannisch | Aragonés | العربية | Asturianu | Български | Català | Česky | Cymraeg | Dansk | Deutsch | Eʋegbe | Ελληνικά | English | Español | Esperanto | Euskara | Estremeñu | فارسی | Français | Galego | 한국어 | हिन्दी | Hrvatski | Ido | Bahasa Indonesia | Íslenska | Italiano | עברית | Kurdî / كوردی | Latina | Lietuvių | Latviešu | Magyar | Македонски | Bahasa Melayu | Nederlands | ‪Norsk (bokmål)‬ | ‪Norsk (nynorsk)‬ | 日本語 | Polski | Português | Ripoarisch | Română | Русский | Shqip | Slovenčina | Slovenščina | Српски / Srpski | Svenska | ไทย | Tagalog | Türkçe | Українська | Tiếng Việt | Walon | ‪中文(简体)‬ | ‪中文(繁體)‬ | zh-yue-hant | +/-

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeDimensionsUserComment
current18:04, 12 April 2008368×374 (13 KB)David Eppstein ({{Information |Description=The Gray configuration, 27 points and 27 lines meeting three lines to a point and three points to a line, drawn as a perspective view of a three-dimensional 3x3x3 grid. |Source=self-made |Date=April 12, 2008 |)
The following pages on the English Wikipedia link to this file (pages on other projects are not listed):