b****r 发帖数: 1272 | 1 As shown in figure: In 3D, Given 2 links attached end to end with lengths
L1 and L2 respectively, a point P1 that the first link starts at, and a
point P2 that you want the end of the 2nd link to be at, write a function
that finds the configurations of the links that put the 2nd link’s end at
point P2.
我的理解是这个function是(P1,P2,L1,L2),但是输出(link的configuration
)应该怎么表达呢? 是不是应分三种情况讨论:
1.if distance(P1,P2) > L1+L2 : 无解(不可能把线段L2放到P2点)
2.if distance(P1,P2) == L1+L2 : 有唯一解 (两个线段在一直线上,交点就是P1,P2
中点)这个情况funct | t****t 发帖数: 6806 | 2 题目里没要求找出所有解, 你随便给一个解就好了.
通解是一个圆, 你给圆的方程应该也是可以的.
P2
数表达向量?
【在 b****r 的大作中提到】 : As shown in figure: In 3D, Given 2 links attached end to end with lengths : L1 and L2 respectively, a point P1 that the first link starts at, and a : point P2 that you want the end of the 2nd link to be at, write a function : that finds the configurations of the links that put the 2nd link’s end at : point P2. : 我的理解是这个function是(P1,P2,L1,L2),但是输出(link的configuration : )应该怎么表达呢? 是不是应分三种情况讨论: : 1.if distance(P1,P2) > L1+L2 : 无解(不可能把线段L2放到P2点) : 2.if distance(P1,P2) == L1+L2 : 有唯一解 (两个线段在一直线上,交点就是P1,P2 : 中点)这个情况funct
| b****r 发帖数: 1272 | 3 先谢了!
1. 请问这个交点怎么找好呢?假设先求P3(x3,y3,z3)的任意一个解,我们知道它满足:
(x1-x3)^2+(y1-y3)^2+(z1-z3)^2 = L1*L1
(x2-x3)^2+(y2-y3)^2+(z2-z3)^2 = L2*L2
两个方程,三个未知数?是否要把一个方向给一个值(比如假设z3=0),然后求x3,y3?
2. 有了x3,y3,z3,可以求出两个向量表示L1和L2,如:
link1 = 2i + 4j - 3k
link2 = 3i + 2j - 1k
我的函数是不是就应该返回这6个系数就可以了?
3. 圆的情况,需要用三角函数求出半径吧?
谢谢!先前没做过这种题,真没什么头绪
【在 t****t 的大作中提到】 : 题目里没要求找出所有解, 你随便给一个解就好了. : 通解是一个圆, 你给圆的方程应该也是可以的. : : P2 : 数表达向量?
| t****t 发帖数: 6806 | 4 立体几何自己算算就好了, 我比较懒, 不帮你算了.
满足:
y3?
【在 b****r 的大作中提到】 : 先谢了! : 1. 请问这个交点怎么找好呢?假设先求P3(x3,y3,z3)的任意一个解,我们知道它满足: : (x1-x3)^2+(y1-y3)^2+(z1-z3)^2 = L1*L1 : (x2-x3)^2+(y2-y3)^2+(z2-z3)^2 = L2*L2 : 两个方程,三个未知数?是否要把一个方向给一个值(比如假设z3=0),然后求x3,y3? : 2. 有了x3,y3,z3,可以求出两个向量表示L1和L2,如: : link1 = 2i + 4j - 3k : link2 = 3i + 2j - 1k : 我的函数是不是就应该返回这6个系数就可以了? : 3. 圆的情况,需要用三角函数求出半径吧?
| b****r 发帖数: 1272 | 5 谢了! 感觉要求一组解也要坐标系旋转/移动什么的 还挺麻烦的
【在 t****t 的大作中提到】 : 立体几何自己算算就好了, 我比较懒, 不帮你算了. : : 满足: : y3?
| O*******d 发帖数: 20343 | 6 The solution, if exists, is a circle in 3D space with radius ranging from 0
to min(L1, L2). A circle in 3D space can have a center (x,y,z), a radius
and an orientation normal vector. The orientation vector is the line (P1,
P2) normalized, the center must be on the line (P1, P2). You need to do
some simple 2D trigonometry calculation to figure out the radius and
position of the center. |
|