Qline:F:angle seems not correct
-
Hello,
according to code
https://codebrowser.dev/qt6/qtbase/src/corelib/tools/qline.cpp.html#_ZNK6QLineF5angleEv
L564 angle()
const qreal theta = qRadiansToDegrees(qAtan2(-dy, dx)); // why negative dya line with point (0, 0) (0, 1) , angle() returns 270
according to doc
The angles are measured counter-clockwise from x axis, so the correct result should be 90.In my opinion, the negative sign before dy should be removed.
-
Counter clockwise so 0 degree is right, 90 is up, 180 left and 270 down. This matches the Qt coordinate system: https://doc.qt.io/qt-6/coordsys.html
-
Counter clockwise so 0 degree is right, 90 is up, 180 left and 270 down. This matches the Qt coordinate system: https://doc.qt.io/qt-6/coordsys.html
@Christian-Ehrlicher Thank you very much !