             .attr('y1', height)
             .style('stroke-opacity', 1e-6)
             .remove()
-
         
     initAxes: ->
         @xScale = d3.scale.linear() # sim units -> screen units

            .attr("id", "plot")
            .attr("transform", "translate(#{margin.left},#{margin.top})")

        @draw(@x, @y)
        #@circ([200,100])
        #@circ([100,200])


class Simulation

    constructor: ->

        xm = 0;
        ym = 0.275;

        g = (x) ->
            (x<0)*(-0.5+(x+0.5)*(2*ym+1)/(2*xm+1)) + (x>=0)*(ym+(x-xm)*(1-2*ym)/(1-2*xm))
        
        q = (y) -> Math.floor((y+0.875)/2*20) 

        x = [-0.5, 0, 0.5]
        @p = new Plot x, (g(u) for u in x)

        @sun = new Sun g, q
        @h = new Histo
        
    start: () ->
        setTimeout (=> @animate 20000), 200
