לדלג לתוכן

קובץ:Relative neighborhood graph.svg

תוכן הדף אינו נתמך בשפות אחרות.
מתוך ויקיפדיה, האנציקלופדיה החופשית

לקובץ המקורי(קובץ SVG, הגודל המקורי: 450 × 450 פיקסלים, גודל הקובץ: 53 ק"ב)

ויקישיתוף זהו קובץ שמקורו במיזם ויקישיתוף. תיאורו בדף תיאור הקובץ המקורי (בעברית) מוצג למטה.

תקציר

תיאור
English: The relative neighborhood graph of 100 random points in a square
תאריך יצירה
מקור נוצר על־ידי מעלה היצירה
יוצר David Eppstein

רישיון

Public domain ברצוני, בעלי זכויות היוצרים על יצירה זו, לשחרר יצירה זו לנחלת הכלל. זה תקף בכל העולם.
יש מדינות שבהן הדבר אינו אפשרי על פי חוק, אם כך:
אני מעניק לכל אחד את הזכות להשתמש בעבודה זו לכל מטרה שהיא, ללא תנאים כלשהם, אלא אם כן תנאים כאלה נדרשים על פי חוק.

Source code

This image was created with the following Python source code and then recolored and converted to SVG in Adobe Illustrator.

from pyx import canvas,path,color
from math import *
from random import seed,random
seed(12345)

npoints = 100
radius = 0.05
exclusion = 0.2     # prevent points from being too close
scale = 5
beta1 = 1.1
beta2 = 0.9
theta1 = asin(1/beta1)
theta2 = pi - asin(beta2)

def dist2(p,q):
    return (p[0]-q[0])**2 + (p[1]-q[1])**2

points = []
while len(points) < 100:
    p = (random()*scale,random()*scale)
    if points:
        nn = min(dist2(p,q)**0.5 for q in points)
        if nn < exclusion:
            continue
    points.append(p)

def neighbors(p,q):
    for r in points:
        if max(dist2(p,r),dist2(q,r)) < dist2(p,q):
            return False
    return True

c = canvas.canvas()

def edge(p,q):
    c.stroke(path.line(p[0],p[1],q[0],q[1]),
             [color.rgb.black])

def point(p):
    c.fill(path.circle(p[0],p[1],radius),[color.rgb.red])

for p in points:
    for q in points:
        if p < q and neighbors(p,q):
            edge(p,q)

for p in points:
    point(p)

c.writePDFfile("Relative_neighborhood_graph")

כיתובים

נא להוסיף משפט שמסביר מה הקובץ מייצג

פריטים שמוצגים בקובץ הזה

מוצג

היסטוריית הקובץ

ניתן ללחוץ על תאריך/שעה כדי לראות את הקובץ כפי שנראה באותו זמן.

תאריך/שעהתמונה ממוזערתממדיםמשתמשהערה
נוכחית02:07, 16 באפריל 2010תמונה ממוזערת לגרסה מ־02:07, 16 באפריל 2010‪450 × 450‬ (53 ק"ב)David Eppstein{{Information |Description={{en|1=The relative neighborhood graph of 100 random points in a square}} |Source={{own}} |Author=David Eppstein |Date=2010-04-15 |Permission= |other_versions= }} [[Ca

אין בוויקיפדיה דפים המשתמשים בקובץ זה.

שימוש גלובלי בקובץ

אתרי הוויקי השונים הבאים משתמשים בקובץ זה: