【发布时间】:2009-04-19 13:59:22
【问题描述】:
如何通过 CGAL 中两条线/向量/方向之间的角度生成用于旋转点/其他点的变换矩阵?
2D 是我需要的。 3D是我喜欢的。
【问题讨论】:
如何通过 CGAL 中两条线/向量/方向之间的角度生成用于旋转点/其他点的变换矩阵?
2D 是我需要的。 3D是我喜欢的。
【问题讨论】:
根据the manual,您可以使用以下工具:
Aff_transformation_2<Kernel> t ( const Rotation, Direction_2<Kernel> d, Kernel::RT num, Kernel::RT den = RT(1))在方向 d 指示的角度上近似旋转,使得 d 给出的旋转的正弦和余弦与近似旋转之间的差异最多为 num/den。 前提条件:num/den>0 和 d != 0。
Aff_transformation_2<Kernel> t.operator* ( s)组成两个仿射变换。
Aff_transformation_2<Kernel> t.inverse ()给出逆变换。
使用它们,您应该能够计算对应于两个方向的矩阵,并使用如下方式的恒等式:
Mat(d1-d2) === Mat(d1)*Inv(Mat(d2))
得到你想要的。
【讨论】: