OrientedPoint2D AbstractFeatureSetMatcher::generateHypothesis(const std::pair< std::pair<InterestPoint *, InterestPoint *>, std::pair<InterestPoint *, InterestPoint *> > &correspondences) const
{
    Point2D baseDelta = correspondences.first.first->getPosition() - correspondences.second.first->getPosition();
    Point2D transformedDelta = correspondences.first.second->getPosition() - correspondences.second.second->getPosition();
    const Point2D& baseSecond = correspondences.second.first->getPosition();
    const Point2D& transformedSecond = correspondences.second.second->getPosition();
    double denominator = 1. / (baseDelta * baseDelta);
    double cosalpha = denominator * (baseDelta * transformedDelta);
    double sinalpha = - denominator * (baseDelta.ortho() * transformedDelta);
    double x = transformedSecond.x - cosalpha * baseSecond.x + sinalpha * baseSecond.y; 
    double y = transformedSecond.y - cosalpha * baseSecond.y - sinalpha * baseSecond.x;
    return OrientedPoint2D(x, y, atan2(sinalpha, cosalpha));
}