rotate plane onto another with respective point transformation using geom3d

1 回表示 (過去 30 日間)
Francesco
Francesco 2013 年 6 月 5 日
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 Center および File ExchangeNumerical Integration and Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by