rotate plane onto another with respective point transformation using geom3d

2 次查看(过去 30 天)
Hello,
I am trying to use geom3d package (but if other simple solutions are available please feel free to comment), to do the following.
I have two planes defined by v1 and v2 normals. In the plane 1, I have a shape, I would like to rotate this shape onto v2 plane.
I tried calculating the angles and using the rotation matrices as well, but I must have done something wrong.
Thank you,
F

回答(1 个)

Matt J
Matt J 2013-6-6
Once you find the axis where the 2 planes intersect, you can use this FEX file
  2 个评论
Francesco
Francesco 2013-6-10
Hi,
That helped a lot.
However, it breaks when the rotation angle is 90 degrees I think. I get errors like
Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN. > In AxelRot at 94 In AxelRot at 63 In large_simulation at 193
What to do in this case? Ideally I would like to have a general method.
Thanks though!
Francesco
Matt J
Matt J 2013-6-10
I can't reproduce what you're seeing. I have no problem with 90 degree rotation angles:
>> AxelRot(90,rand(1,3),rand(1,3))
ans =
0.5112 -0.3386 0.7900 -0.5113
0.8570 0.1315 -0.4982 0.7010
0.0648 0.9317 0.3574 0.1863
0 0 0 1.0000
It would help if you copy/paste your exact error messages, as well as give me the data you're passing to AxelRot, i.e., deg, u, and x0. If you're using Syntax III, just give me a small selection of XYZold. I don't need the whole thing.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Cartesian Coordinate System Conversion 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by