An instance of the data type Segment_d is a directed straight line segment in -dimensional Euclidean space connecting two points and . is called the source point and is called the target point of , both points are called endpoints of . A segment whose endpoints are equal is called degenerate.
| |
the representation type.
| |
| |
the ring type.
| |
| |
the field type.
| |
| |
the linear algebra layer.
|
| |
introduces a variable s
of type Segment_d<Kernel>.
| |
| |
introduces a
variable s of type Segment_d<Kernel> which is initialized to
the segment . Precondition: p.dimension()==q.dimension().
| |
| |
introduces a
variable s of type Segment_d<Kernel> which is initialized to
the segment (p,p+v). Precondition: p.dimension()==v.dimension().
|
|
| returns the dimension of the ambient space. |
|
| returns the source point of segment s. |
|
| returns the target point of segment s. |
|
|
returns source or target of
s: vertex(0) returns the source, vertex(1) returns
the target. The parameter is taken modulo , which gives easy
access to the other vertex. Precondition: . |
|
| returns vertex(i). |
|
| returns vertex(i). |
|
| returns the lexicographically smaller vertex. |
|
| returns the lexicographically larger vertex. |
|
| returns the segment (target(),source()). |
| ||
|
returns the direction from
source to target. Precondition: s is non-degenerate. | |
|
| returns the vector from source to target. |
|
| |
returns the square of the length of s. | ||
|
| |
returns true if lies
on s and false otherwise. Precondition: s.dimension()==p.dimension(). | ||
|
| |
returns the supporting line
of s. Precondition: s is non-degenerate. | ||
|
| |
returns . Precondition: s.dimension()==t.dimension(). | ||
|
| |
returns
, i.e., s translated by vector . Precondition: s.dimension()==v.dimension(). | ||
|
| returns true if s is degenerate i.e. s.source()=s.target(). |
|
| |
Test for equality as unoriented
segments. Precondition: s1.dimension()==s2.dimension(). | ||
|
| |
return true if one of the segments is degenerate or if the
unoriented supporting lines are parallel. Precondition: s1.dimension()==s2.dimension(). | ||
|
| |
if s1 and s2
touch in a common end point, this point is assigned to common
and the result is true, otherwise the result is false. If
s1==s2 then one of the endpoints is returned. Precondition: s1.dimension()==s2.dimension(). |
Segments are implemented by a pair of points as an item type. All operations like creation, initialization, tests, the calculation of the direction and source - target vector, input and output on a segment take time . dimension(), coordinate and end point access, and identity test take constant time. The operations for intersection calculation also take time . The space requirement is .