# Class: DirectedEdge

## jsts.geomgraph.DirectedEdge

Source:

### Members

• boolean
Source:

#### depth :Array.<number>

The depth of each side (position) of this edge. The 0 element of the array is never used.
##### Type:
• Array.<number>
Source:

#### (protected) edge :Edge

the parent edge of this edge end
• Edge
Inherited From:
Source:

• Label
Overrides:
Source:

### Methods

#### (static) depthFactor()

Computes the factor for the change in depth when moving from one location to another. E.g. if crossing from the INTERIOR to the EXTERIOR the depth decreases, so the factor is -1
Source:

#### compareDirection(e) → {number}

Implements the total order relation:

a has a greater angle with the positive x-axis than b

Using the obvious algorithm of simply computing the angle is not robust, since the angle calculation is obviously susceptible to roundoff. A robust algorithm is: - first compare the quadrant. If the quadrants are different, it it trivial to determine which vector is "greater". - if the vectors lie in the same quadrant, the computeOrientation function can be used to decide the relative orientation of the vectors.

##### Parameters:
Name Type Description
`e` EdgeEnd
Inherited From:
Source:
Type
number

#### getSym()

Each Edge gives rise to a pair of symmetric DirectedEdges, in opposite directions.
Source:
##### Returns:
the DirectedEdge for the same Edge but in the opposite direction.

#### (protected) init(p0, p1)

##### Parameters:
Name Type Description
`p0` Coordinate
`p1` Coordinate
Inherited From:
Source:

#### isInteriorAreaEdge()

This is an interior Area edge if
• its label is an Area label for both Geometries
• and for each Geometry both sides are in the interior.
Source:
##### Returns:
true if this is an interior Area edge.

#### isLineEdge()

This edge is a line edge if
• at least one of the labels is a line label
• any labels which are not line labels have all Locations = EXTERIOR
Source:

#### setEdgeDepths()

Set both edge depths. One depth for a given side is provided. The other is computed depending on the Location transition and the depthDelta of the edge.
Source:

#### setVisitedEdge()

setVisitedEdge marks both DirectedEdges attached to a given Edge. This is used for edges corresponding to lines, which will only appear oriented in a single direction in the result.
Source: