Sha256: 71a01ffcb97a3f846babb8eee3463855931aaad0c5c26a2078f87ee708fd9f92
Contents?: true
Size: 674 Bytes
Versions: 1
Compression:
Stored size: 674 Bytes
Contents
require_relative 'point' module Geometry =begin rdoc Circles come in all shapes and sizes, but they're usually round. == Usage circle = Geometry::Circle.new [1,1], 2 =end class Circle # @return [Point] The Circle's center point attr_reader :center # @return [Number] The Circle's radius attr_reader :radius # Construct a new {Circle} from a centerpoint and radius # @param [Point] center The center point of the Circle # @param [Number] radius The radius of the Circle # @return [Circle] A new Circle object def initialize(center, radius) @center = center.is_a?(Point) ? center : Point[center] @radius = radius end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
geometry-3 | lib/geometry/circle.rb |