[i]
C++ (Qt)qreal dot = a.x*b.x+a.y*b.y;
C++ (Qt)qreal cross = (p.x-p1.x) * (p2.y-p1.y) - (p2.x-p1.x) * (p.y-p1.y);