Jump to content

Rotation in vertical plan [geometric formula]


MSasu

Recommended Posts

Since the analytical geometry is my weak spot (one of...) I would appreciate if someone may help me with the formula to rotate a point (P2) around another one (P1) in the vertical plan defined by them with a given angle (alfa) – I’m looking for the formula to get the result point (P3).

I have to mention that I will use this in other programming language, so an AutoCAD based graphical solution is out of question.

 

Thank you for attention!

Link to comment
Share on other sites

Hi Mircea, my first thought when I looked at your question was:

 

x3 = x1 + (x2-x1).cos(alfa) - (y2-y1).sin(alfa)
y3 = y1 + (x2-x1).sin(alfa) + (y2-y1).cos(alfa)
z3 = z1

That is a rotation around the z axis of point P1 using the AutoCAD convention that an anti-clockwise angle is positive and clockwise is negative. But I'm a bit worried that I'm misreading this...

 

in the vertical plan defined by them

 

Have I misunderstood the question?

Link to comment
Share on other sites

Clint, thank you for your attention! I'm afraid that you misunderstood the question, indeed. I will try to post a picture.

Link to comment
Share on other sites

If I understand more correctly now Mircea, I think the easiest thing would be to follow the maths in Lee Mac's LM:Rotate3D function under 3D transformations. If you can convert it and the associated matrix multiplication functions to the other programming language it should do the trick.

 

http://www.lee-mac.com/matrixtransformationfunctions.html

 

You would need to provide the normal unit vector to rotate around, defined in Lee's function by u, ux, uy & uz.

 

I understand that the rotation you want to achieve is always in the vertical plane? So to get your normal unit vector you would replace the maths done by this line of code

(mapcar 'set '(ux uy uz) (setq u (unit (mapcar '- p2 p1))))

with

(mapcar 'set '(ux uy uz) (setq u (unit (list (- y2 y1) (- x1 x2) 0))))

where Point P1 is defined by '(x1 y1 z1) and Point P2 is defined by '(x2 y2 z2)

Link to comment
Share on other sites

Looking at the image you need a few more angles not just alpha, if I understand correct that alpha is an angle in a tilted plane, in autocad using UCS its pretty simple it can be solved. I think you need more angles beta & gamma=vert & horiz.

 

Maybe as a start have a google for surveying formula for spheriods if you think of it as a pt on a ball then someone probably has done this. A 3pt wedge formula ? plane cutting sphere ? wheres my google.

Link to comment
Share on other sites

Salut Mircea

 

You need to define an axis of rotation. In Autocad, this is made by picking 2 points (see the old rotate3d command).

So you have a point p to be rotated, an origin and a direction. Now you can apply Rodrigues' rotation formula.

I've write a sample for you. In the final formula, "x" denote cross-product.

3D-rot.pdf

Link to comment
Share on other sites

You need to define an axis of rotation. Now you can apply Rodrigues' rotation formula.

1+

I agree with Stefan, Mircea.

If it helps to avoid any confusion, Lee's function that I referred to is doing that in the form

 

f38880c7bca605595a32c025ebf4a9ab.png

 

as mentioned in that Wikipedia article Rodrigues' rotation formula

Link to comment
Share on other sites

Mircea, here is another solution.

It is just for testing, but if you want to develop this idea further, there are some things that you should consider:

- the normal vector to plane could be in a direction or in the other, so there are 2 possible answers. You can make a convention on what is positive and negative rotation.

- the atan function returns a number in the interval -pi/2...pi/2, but in my solution the true angle is required, in the interval 0...2pi. (that is a.z in attachment). This can be done by studying the relative position of selected points.

3D-rot II.pdf

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...