To check if two segments and are parallel, compute the vector define by each segment and check if the cross product of the vectors is a null vector

First compute vectors and :

Now compute the cross product :

is null if is null or is null or and are parallel.

## C++ source code

/*!

* \brief rOc_segment::isParallel check if current segment and S are parallel

* A null segment is necessarily considered as parallel

* \param S is the segment to check with the current one

* \return true the segments are parallel or at least one of the segment is null

* false the segments are non null and not parallel

*/

bool rOc_segment::isParallel(rOc_segment S)

{

// Extract main vector

rOc_vector VA=this->vector();

rOc_vector VB=S.vector();
// If the dot product is a null vector, segments are parallel (or at least one is null)

return VA.cross(VB).isNull();

}