Sha256: 68ddf937385f580c365f7296694b96053bc23d1285e7c359a1d1f60595e8f59b
Contents?: true
Size: 202 Bytes
Versions: 4
Compression:
Stored size: 202 Bytes
Contents
module Geometer class Line < Struct.new(:a, :b) def length x0,y0 = *a x1,y1 = *b dx = ((x0 - x1) ** 2) dy = ((y0 - y1) ** 2) Math.sqrt( dx + dy ) end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
geometer-0.1.3 | lib/geometer/line.rb |
geometer-0.1.2 | lib/geometer/line.rb |
geometer-0.1.1 | lib/geometer/line.rb |
geometer-0.1.0 | lib/geometer/line.rb |