如何找到具有两个帧的δθ,每个帧有两个点

How to find the delta theta having two frames each having two points?

本文关键字:两个 何找      更新时间:2023-10-16

我正在使用c ++,我正在使用Visual Studio作为IDE,并且正在使用leap Leap Motion SDK

所以,我目前正在研究一个旋转圆的程序。通过使用显示为应用程序上的点。

此外,此应用程序使用帧来显示一段时间内的事件。

我想知道如何使用两个帧和两个点来计算旋转的变化两帧上的两点移动。

const Frame frame = controller->frame();      //current frame
const Frame previous = controller->frame(1);  //previous frame
const FingerList fingers = frame.fingers();   //fingers inside that frame
POINT aFingerPoint = fingers[0].position()    //point of a finger from a finger array    
POINT anotherFingerPoint = fingers[1].position()    //point of a finger from a finger array
const FingerList prevFingers = previous.fingers();   //fingers inside that frame
POINT aPrevFingerPoint = fingers[0].position()    //point of a finger from a finger array    
POINT anotherPrevFingerPoint = fingers[1].position()    //point of a finger from a finger array
// coordinate example
float x = aFingerPoint.x;
float y = aFingerPoint.y; 
float deltaRotation = [THIS PART I DONT KNOW]; //I got the translation already, just need rotation
circle.manipulation(deltaRotation);  //Rotates the circle in degrees
A -

第一指的点,A' - 运动后的第一指点。

B - 第二指的点

,B' - 移动后第二指的点。

如果我理解正确,您的答案将是角度 ABx 和 A'B'x 之间的差异,其中 x - 是 x 轴。它可以很容易地用atan2(dy, dx)函数从,其中dx = Ax-Bx,dy=Ay-By。