public double DistanceToPoint( DoublePoint point )
{
double segmentDistance;
switch ( LocateProjection( point ) )
{
case ProjectionLocation.RayA:
segmentDistance = point.DistanceTo( start );
break;
case ProjectionLocation.RayB:
segmentDistance = point.DistanceTo( end );
break;
default:
segmentDistance = line.DistanceToPoint( point );
break;
};
return segmentDistance;
}