2011-02-13 31 views
0

我要繪製其中對於數據集中的每個邊緣,將在一個N * N網格畫出的線的曲線圖。繪圖歐幾里得平面在紅寶石

例如,對於4×4

**** 
**** 
**** 
**** 

the edge [[1,3], [2,1]] will draw a line between (1,3) and (2,3). 

**0* 
0*** 
**** 
**** 
+1

是什麼 你的問題? – 2011-02-13 06:54:19

回答

0

一格,可與鞋做http://shoesrb.com/

Shoes.app做

A =你的陣列

strokewidth 1.0 
    spread = 10 
    stroke black 
    fill black 
    shape do 
    x = a.first 
    a.each do |x| 
     oval x[0]*spread-2.5, x[1]*spread-2.5, 5 
    end 
    fill white 
    move_to x[0]*spread, x[1]*spread 
    a.each do |x| 
     line_to x[0]*spread, x[1]*spread 
    end 
    end 
end