Module: Geometry::SlopedLine

Included in:
PointSlopeLine, SlopeInterceptLine
Defined in:
lib/geometry/line.rb

Instance Attribute Summary collapse

Instance Attribute Details

#horizontal?Boolean

Returns:

  • (Boolean)


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

def horizontal?
    slope.zero?
end

#slopeObject

Returns the value of attribute slope.



100
101
102
# File 'lib/geometry/line.rb', line 100

def slope
  @slope
end

#vertical?Boolean

Returns:

  • (Boolean)


110
111
112
113
114
# File 'lib/geometry/line.rb', line 110

def vertical?
    slope.infinite? != nil
rescue	# Non-Float's don't have an infinite? method
    false
end