class Geode::Segment
 
  - Geode::Segment
- Geode::Line
- Reference
- Object
Overview
The Segment class represents a two-dimensional line segment with two endpoints.
Included Modules
- Enumerable(Geode::Point)
Defined in:
geode/line.crConstructors
Instance Method Summary
- 
        #==(other : self)
        
          Returns trueif this reference is the same as other.
- 
        #each(&)
        
          Separately yields the two endpoints of the segment. 
- 
        #hash(hasher)
        
          See Object#hash(hasher)
- 
        #include?(other : Point)
        
          Returns whether the given point lies on the segment. 
- 
        #length
        
          Returns the length of the segment. 
- 
        #midpoint
        
          Returns the midpoint of the segment. 
- 
        #p1 : Geode::Point
        
          Returns the first endpoint of the segment. 
- 
        #p2 : Geode::Point
        
          Returns the second endpoint of the segment. 
- 
        #slope
        
          Returns the slope of the segment. 
- 
        #to_line
        
          Returns a Linerepresentation of the segment.
Instance methods inherited from class Geode::Line
  
  
    
      ==(other : self)
    ==, 
    
  
    
      hash(hasher)
    hash, 
    
  
    
      horizontal?
    horizontal?, 
    
  
    
      include?(other : Point)
    include?, 
    
  
    
      slope : Float32 | Float64 | Int128 | Int16 | Int32 | Int64 | Int8 | UInt128 | UInt16 | UInt32 | UInt64 | UInt8
    slope, 
    
  
    
      to_s(io : IO)
    to_s, 
    
  
    
      vertical?
    vertical?, 
    
  
    
      x_intercept
    x_intercept, 
    
  
    
      y_intercept
    y_intercept
    
  
    
  Constructor methods inherited from class Geode::Line
  
  
    
      new(slope : Number::Primitive, intercept_val : Number::Primitive)
    new
    
  
    
  Class methods inherited from class Geode::Line
  
  
    
      perpendicular?(l1 : Line, l2 : Line)
    perpendicular?
    
  
    
  
    
    
    
    
  
    
    
    
    
  
Constructor Detail
Instance Method Detail
        
        def ==(other : self)
        #
      
      
        
              Description copied from class Reference
            
          
          Returns true if this reference is the same as other. Invokes same?.