54 const double fBx =
static_cast<double>(rLine.
maStart.
X()) - rLine.
maEnd.
X();
55 const double fBy =
static_cast<double>(rLine.
maStart.
Y()) - rLine.
maEnd.
Y();
56 const double fDen = fAy * fBx - fAx * fBy;
63 const double fA = fBy * fCx - fBx * fCy;
64 const bool bGreater = ( fDen > 0. );
70 if ( ( fA < 0. ) || ( fA > fDen ) )
73 else if ( ( fA > 0. ) || ( fA < fDen ) )
78 const double fB = fAx * fCy - fAy * fCx;
82 if ( ( fB < 0. ) || ( fB > fDen ) )
85 else if ( ( fB > 0. ) || ( fB < fDen ) )
90 const double fAlpha = fA / fDen;
92 rIntersectionX = (
maStart.
X() + fAlpha * fAx );
93 rIntersectionY = (
maStart.
Y() + fAlpha * fAy );
107 const double fDistX =
static_cast<double>(
maEnd.
X()) -
maStart.
X();
108 const double fDistY =
static_cast<double>(
maEnd.
Y()) -
maStart.
Y();
109 const double fACX =
static_cast<double>(
maStart.
X()) - rPtX;
110 const double fACY =
static_cast<double>(
maStart.
Y()) - rPtY;
111 const double fL2 = fDistX * fDistX + fDistY * fDistY;
112 const double fR = ( fACY * -fDistY - fACX * fDistX ) / fL2;
113 const double fS = ( fACY * fDistX - fACX * fDistY ) / fL2;
123 fDist = fS * sqrt( fL2 );
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
constexpr tools::Long X() const
tools::Long FRound(double fVal)