Object
The class PLRuby::Segment implement the PostgreSQL type lseg
Convert a String (PostgreSQL representation) to a Segment
# File plruby.rb, line 1653 def from_string(string) end
comparison function for the 2 segments, returns
0 if self[0] == other[0] && self[1] == other[1] 1 if distance(self[0], self[1]) > distance(other[0], other[1]) -1 if distance(self[0], self[1]) < distance(other[0], other[1])
# File plruby.rb, line 1664 def <=>(other) end
return the center of the segment
# File plruby.rb, line 1668 def center end
closest point to other
other can be a Point, Segment or Box
With a point, take the closest endpoint if the point is left, right, above, or below the segment, otherwise find the intersection point of the segment and its perpendicular through the point.
# File plruby.rb, line 1679 def closest(other) end
returns true if self is a horizontal Segment
# File plruby.rb, line 1683 def horizontal? end
returns true if self and other intersect
# File plruby.rb, line 1691 def intersect?(other) end
return the length of self, i.e. the distnace between the 2 points
# File plruby.rb, line 1700 def length end
returns true if the 2 Segment self and other are parallel
# File plruby.rb, line 1711 def parallel?(other) end
returns true if self is perpendicular to other
# File plruby.rb, line 1715 def perpendicular?(other) end
conversion function to a Point, return the center of the segment
# File plruby.rb, line 1719 def to_point end
returns true if self is a vertical Segment
# File plruby.rb, line 1723 def vertical? end
Generated with the Darkfish Rdoc Generator 2.