C++ (Qt)QVector3D p0(0, 0, 0);QVector3D p1(0.4, 0,5, 0.7);QVector3D dir(0.707, 0,707, 0.707);alpha = M_Pi / 6 (30 degrees)
C++ (Qt) QVector3D p0(0, 0, 0); QVector3D p1(0.4, 0.5, 0.7); QVector3D dir(0.707, 0.707, 0.707); double alpha = M_PI / 6; QVector3D v = p1 - p0, k = dir - p0; QVector3D v_rot = v * cos(alpha) + QVector3D::crossProduct(k, v) * sin(alpha) + QVector3D::dotProduct(k, v) * (1 - cos(alpha)) * k; qDebug() << v_rot; // QVector3D(0.524257, 0.43411, 0.748715)