In [1]:
include("lorentz-gas2.jl")


Out[1]:
0.445

In [15]:
points = collisions([0, 0.445],[cos(1), sin(1)], 0.1, 30)[1]


Out[15]:
7-element Array{Array{T,1},1}:
 [0.0,0.445]           
 [0.94488,1.91656]     
 [-0.971676,-0.904095] 
 [-0.989769,-0.0994753]
 [-0.0924276,-4.96183] 
 [-2.93286,-6.92589]   
 [0.901081,-0.0146626] 

In [2]:
using PyPlot


INFO: Loading help data...

In [1]:
points1 = [0.0 0.445;     
 0.94488 1.91656;  
 -0.971676 -0.904095; 
 -0.989769 -0.0994753;
 -0.0924276 -4.96183; 
 -2.93286 -6.92589;   
 0.901081 -0.0146626]


Out[1]:
7x2 Array{Float64,2}:
  0.0         0.445    
  0.94488     1.91656  
 -0.971676   -0.904095 
 -0.989769   -0.0994753
 -0.0924276  -4.96183  
 -2.93286    -6.92589  
  0.901081   -0.0146626

In [3]:
plot(points1[:,1], points1[:,2])
xlim(-3.5, 1.5); ylim(-8, 3)

r=0.1
for n = -5:2
    for m = -10:3
        x = linspace(-10,10,1000)
        y1 = m + sqrt(r^2 - (x-n)^2)
        y2 = m - sqrt(r^2 - (x-n)^2)
        plot(x, y1)
        plot(x, y2)
    end
end


`*` has no method matching *(::Array{Float64,1}, ::Array{Float64,1})
while loading In[3], in expression starting on line 5

 in getindex at /home/kriukov/.julia/PyCall/src/PyCall.jl:638
 in pysequence_query at /home/kriukov/.julia/PyCall/src/conversions.jl:743
 in pytype_query at /home/kriukov/.julia/PyCall/src/conversions.jl:759
 in convert at /home/kriukov/.julia/PyCall/src/conversions.jl:808
 in pycall at /home/kriukov/.julia/PyCall/src/PyCall.jl:808
 in fn at /home/kriukov/.julia/PyCall/src/conversions.jl:181
 in close_queued_figs at /home/kriukov/.julia/PyPlot/src/PyPlot.jl:231
/usr/lib/pymodules/python2.6/matplotlib/backends/backend_gtk.py:621: DeprecationWarning: Use the new widget gtk.Tooltip
  self.tooltips = gtk.Tooltips()

In [ ]: