Class: Geometry::PointSlopeLine

Inherits:
Line
  • Object
show all
Defined in:
lib/geometry/line.rb

Overview

/# PointSlopeLine #/#

Instance Attribute Summary collapse

Attributes inherited from Line

#options

Instance Method Summary collapse

Methods inherited from Line

[], horizontal, new, vertical

Methods included from ClusterFactory

included

Constructor Details

#initialize(point, slope) ⇒ PointSlopeLine

Returns a new instance of PointSlopeLine.



104
105
106
107
# File 'lib/geometry/line.rb', line 104

def initialize(point, slope)
    @point = Point[point]
    @slope = slope
end

Instance Attribute Details

#slopeNumber (readonly)

Returns the slope of the Line.

Returns:

  • (Number)

    the slope of the Line



102
103
104
# File 'lib/geometry/line.rb', line 102

def slope
  @slope
end

Instance Method Details

#to_sObject



108
109
110
# File 'lib/geometry/line.rb', line 108

def to_s
  'Line(' + @slope.to_s + ',' + @point.to_s + ')'
end