rotate plane onto another with respective point transformation using geom3d

3 views (last 30 days)
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

Answers (1)

Matt J
Matt J on 6 Jun 2013
Once you find the axis where the 2 planes intersect, you can use this FEX file
  2 Comments
Francesco
Francesco on 10 Jun 2013
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 on 10 Jun 2013
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.

Sign in to comment.

Categories

Find more on Cartesian Coordinate System Conversion in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!