如何找到具有两个帧的δθ,每个帧有两个点
How to find the delta theta having two frames each having two points?
我正在使用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。
相关文章:
- 如何在C++中从两个单独的for循环中添加两个数组
- 为什么两个不同的未命名名称空间可以共存于一个cpp文件中
- 当在同一名称空间中有两个具有相同签名的函数时,会发生什么
- 如何返回一个类的两个对象相加的结果
- 如何在C++中将一个无符号的 int 转换为两个无符号的短裤?
- 图问题:找出两个节点是否在每个节点的O(1)时间和O(2)存储中共享同一分支
- 如何找出在两个整数的乘积中设置了多少位(等于 1)
- 找出两个给定单词和字典之间最短的单词阶梯
- 找出3D空间中两个对象的公式
- NetBeans - 两个项目 - 一个找不到要包含的文件 (C++)
- 我有两个点和一个时间,我如何找出向量
- 如何找出两个图像之间的对象差异
- 比较两个文件,找出区别
- 比较两个值,找出最接近用户输入的值
- 找出两个异或最大的元素
- 找出图中两个节点之间的所有路径
- 在三维空间的一组点中找出两个距离最远的点
- 给定一个整数数组,找出两个数字,使它们加起来等于一个特定的目标数
- 找出两个范围(其中一个已排序)是否有一个公共元素
- 用C++程序提取两个句子,找出常见的字母