Sha256: 2de2dcba8a4fd4aca17268a798d03cff7d04613cd738c793b69c4f7bd8d373c4
Contents?: true
Size: 541 Bytes
Versions: 1
Compression:
Stored size: 541 Bytes
Contents
module Straightedge module Figures class Quadrilateral < Figure attr_reader :dimensions def_delegator :dimensions, :x, :width def_delegator :dimensions, :y, :height def initialize(dimensions: [1,1], location: ORIGIN, color: :white) super([], location: location, color: color) @dimensions = dimensions @marks = corners end def corners(w=width, h=height) @corners ||= [[x,y],[x,y+h],[x+w,y+h],[x+w,y]] #Rose.simple.project(origin).map { |xy| [xy.x*w, xy.y*h] } end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
straightedge-0.1.1 | lib/straightedge/figures/quadrilateral.rb |