Sha256: 621e6a826fa1b9757c8e1c480bde147b75e91a2fbbcc49867955181cf34ecb2b
Contents?: true
Size: 387 Bytes
Versions: 1
Compression:
Stored size: 387 Bytes
Contents
module Straightedge class Ruler def initialize(unit=1) @unit = unit end class << self def default; @default ||= new end def translate(xy, dxy) xy.zip(dxy).map { |x,y| x+y } end def distance(alpha,beta) Line.new(alpha,beta).length #dx, dy = alpha.x - beta.x, alpha.y - beta.y #Math.sqrt(dx*dx + dy*dy) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
straightedge-0.1.0 | lib/straightedge/ruler.rb |