 
 # for easy angle comparison without converting sines and cosines to angles
 class TrigPair
-  constructor: ( x, y, minDistance, distance ) ->
+  init: ( x, y, minDistance, distance ) ->
     if distance?
       sine = @sine = x
       cosine = @cosine = y

  touching: ->
    @universe.near @, @radius, 1
  margins: ->
    @marges ||= do =>
      fi = Math.PI * @visualAngle() / 2
      t1 = @angle - fi
      t1 = new TrigPair( Math.sin(t1), Math.cos(t1) )
      t2 = @angle + fi
      t2 = new TrigPair( Math.sin(t2), Math.cos(t2) )
      [ t1, t2 ]

class Stone extends Thing
  constructor: ( location, options = {} ) ->

  vector: (magnitude) ->
    [ @width * magnitude, @height * magnitude ]
  # generates the counterpart of @ TrigPair after a 180 degree rotation
  opposite: (u) ->
    return @ if @tooFar
    op = u.tp( -@sine, -@cosine, null, @distance )
    op.width = -@width
    op.height = -@height
    op
