QVector3D v(1, 2, 3); v.normalize();
QVector3D v1(1, 0, 0); QVector3D v2(0, 1, 0); v1.normalize(); v2.normalize(); float cosine = QVector3D::dotProduct(v1, v2);This code creates two 3D vectors: v1 with the values (1, 0, 0) and v2 with the values (0, 1, 0). Then, it normalizes both vectors and computes the cosine of the angle between them using the dot product method. The resulting value is 0, which means that the vectors are perpendicular. Package library: Qt.