 
introduces a segment s with source $$p
and target $$q. It is directed from the source towards
the target.


 
Test for equality: Two segments are equal, iff their sources and targets are equal.  

 
Test for inequality.  

 returns the source of s. 

 returns the target of s. 

 returns the point of s with smallest coordinate (lexicographically). 

 returns the point of s with largest coordinate (lexicographically). 

 returns source or target of s: vertex(0) returns the source, vertex(1) returns the target. The parameter i is taken modulo 2, which gives easy access to the other vertex. 

 returns vertex(i). 

 
returns vertex(i).  

 
returns the squared length of s.  

 returns the vector s.target()  s.source(). 
 
 returns the direction from source to target.  

 returns a segment with source and target interchanged. 

 
returns the line $$l passing through s. Line $$l has the same orientation as segment s, that is from the source to the target of s.  

 segment s is degenerate, if source and target fall together. 

 
A point is on s, iff it is equal to the source or target of s, or if it is in the interior of s.  

 returns a bounding box containing s. 

 
returns the segment obtained by applying $$t on the source and the target of s. 