Important: Please read the Qt Code of Conduct  https://forum.qt.io/topic/113070/qtcodeofconduct
Math functions/constants in QML code: i.e. M_PI or sin/cos/tg

Hello,
I am trying to use math functions and constants within my QML code but I am getting an error:
ReferenceError: M_PI is not defined.
I included the #include <QtMath> into main.cpp but it looks like is not enough to see the functions in my QML code.
How do I include it in QML ?
thx

@biskero
QML uses JavaScript for that
for pi you simply write Math.PIbtw, what you include in cpp has little to no influence for qml

@J.Hilk said in Math functions/constants in QML code: i.e. M_PI or sin/cos/tg:
Math
So I need to prepend Math. to any Math function I use like sqrt/sin/cos/tan, any link?
thx!

@biskero please see here: https://developer.mozilla.org/enUS/docs/Web/JavaScript/Reference/Global_Objects/Math