# Rotation about x, y and z-axis from xy, yz and xz plane

Discussion in 'Homework Help' started by zulfi100, Mar 27, 2015.

1. ### zulfi100 Thread Starter Member

Jun 7, 2012
320
0
Hi,
I want to do a rotation of a point on xy, yz and xz plane. I am first doing it for a point on xy plane.
After counter clock-wise rotation of point on xy plane about x-axis, the point will move to xz plane.

After clock-wise rotation of point on xy plane about y-axis, the point will move to yz plane.

After clock-wise rotation of point on xy plane about z-axis, the point will align with x-axis and after counter clock-wise rotation of point on xy plane about z-axis, the point will align with y-axis.

The angle of rotation is not necessarily 90 degrees. Some body please guide me whether my results are correct or not.

Zulfi.

Last edited: Mar 27, 2015
2. ### WBahn Moderator

Mar 31, 2012
18,093
4,918
If the angle of rotation is not necessarily 90°, then how can a point in one of the cardinal planes end up on another cardinal plane?

When you say "counter clockwise", you mean counter clockwise from who's perspective?

3. ### zulfi100 Thread Starter Member

Jun 7, 2012
320
0
Hi,
Perhaps we might be doing a 360 degree rotation and we would stop once we land on xz plane. Book does not say that the angle is 90 degrees. I have attached the figure. They have used angle ∝. I would quote what the book says but it uses a vector instead of a point.

Please tell me from the same perspective which the book is doing. I want to understand book's concept. Please guide me how to find the angle ∝.

Zulfi.

Last edited: Mar 28, 2015
4. ### zulfi100 Thread Starter Member

Jun 7, 2012
320
0
Hi,
I forgot to upload one image:

I cant understand how to find out the sine and cosine values for this rotation. First they rotated about x-axis to bring the vector u in the xz plane.

For this they have shown:

cos alpha = u'. uz/ |u'| |uz| = c/d

I cant understand how they got c/d. They have defined unit vector u as:

u = V/ |V| = (a, b, c)

In a figure's description they say:

Even i cant understand the above statement.

Zulfi.

Last edited: Mar 28, 2015
5. ### WBahn Moderator

Mar 31, 2012
18,093
4,918
If they use a 360° rotation, then they would end up right back where they started.

How can I tell you what the perspective of the book is? It's YOUR book! I'm not a mind reader. YOU have to tell US what the perspective of YOUR book is.

6. ### MrAl Distinguished Member

Jun 17, 2014
2,573
521
Hi,

If you can show more scans of your actual book, somebody here can probably help you much better. Dont be a afraid to take a few more scans, as long as you dont scan an entire chapter or something. Make sure the equations can be read and the text is large enough to read easily.

7. ### zulfi100 Thread Starter Member

Jun 7, 2012
320
0
Hi my friend,

Zulfi.

File size:
29.6 KB
Views:
18
File size:
17.7 KB
Views:
17
8. ### zulfi100 Thread Starter Member

Jun 7, 2012
320
0
Hi,

If there is any problem please let me know.

Zulfi.

9. ### MrAl Distinguished Member

Jun 17, 2014
2,573
521
Hi again,

Ok, wow lots of pages

I noticed there is a page 272_2 but no 272_1, is that missing or just that 272_2 is the only part of that page?

What part are you getting stuck at?

10. ### zulfi100 Thread Starter Member

Jun 7, 2012
320
0
Hi,
I am able to understand page 266 (the heading page), page 267, page 268. My trouble starts from page 269 after the translation matrix. I cant understand how to determine cos and sin values and the associated matrices for rotation around x-axis and about y-axis. I am providing you the book link also:
https://books.google.com.pk/books?id=4D9IqeflmswC&lpg=PA269&ots=9SJGkxLhzL&dq="Rotation of u around the x axis"&pg=PA267#v=onepage&q="Rotation of u around the x axis"&f=false

I would also do the scanning today. I understand you have to read from beginning otherwise you wont get background information. But my problem concentrates mainly on sine and cosine values. I would show you the summary of my problem:

Above are two images. Please check them. They are not so dull (low intensity). Thanks for taking interest in my problem. I wish you a great and prosperous future.

Zulfi.

11. ### zulfi100 Thread Starter Member

Jun 7, 2012
320
0

Hi,
Thanks for giving time to my problem. I have uploaded the scanned images of my book pages. But this is different edition so page numbers are different but contents and pictures are same. Note last page i.e. 439 is not required, so you can leave the last matrix in the previous upload also. Altogether there are seven steps:
A.Translate the point (x1,y1,z1) and (x2,y2,z2) to the original.
B.Rotate about the X-axis until the rotation axis is the x,z plane.
C.Rotation about Y-axis until the rotation axis corresponds to the z-axis.
D.Rotation about the z-axis angle .
E.Perform the inverse rotation of the step c.
F.Perform the inverse rotation of the step B.
G.Perform the inverse rotation of the step A.

I am not able to understand steps B & C (i.e. step 2 & 3) above. In these steps, how to find out cosine & sine values in terms of a, b, c, & d. I cant understand what is need for the Unit vector. How to obtain the projection of rotation access in yz plane, although we are in xz plane (i.e. step B or step 2). Somebody please guide me.

Zulfi.

12. ### MrAl Distinguished Member

Jun 17, 2014
2,573
521
Hello again,

The notation for this book might be a little unusual, so that's what we have to address first.
Because of the way they wrote out the 'sin' type cross product it appears that they use the notation:'uz' which is really read:
"u sub z" or sometimes as u_z (we cant use subscripts in this forum i dont think unless we use a bitmap).
So the unit vector u in the direction of z in square bracket notation is [0,0,1], not [0,0,c].

I think that is the root of your problem in solving for the angles. Once the formula they give is used with that in mind you'll get the same result they did which is c/d for that one angle.

If this isnt clear i'll draw up a bitmap, but try that first and see if you can get it working correctly.
BTW again once you have the right angles, you should try a few points to make sure you did it right. This is always a good idea even if it looks simple.

At the moment this topic is probably more interesting for me than other readers here because i was recently updating my drawing program used for detailing pictures of real life subjects as well as technical drawings. My older program suffered from a little problem when i updated by graphics card to a "high end" type graphics card (note that is in quotes because it is now questionable). With the older graphics card it worked fine, with the new one it started to go nuts if you zoom in too much, so i had to start updating it to work an entirely different way (as to drawing objects). So you can see computer graphics is also interesting for me too. Right now i use more of an 'incremental' type method, but the calculation type methods you are looking at are better because there is no storage involved so it's basically simpler
One thing i have learned in the past is that i have to test and retest the program to make sure it continues to work before and after every operation. You dont know how many times it can look right but really isnt, so when you do a certain operation it doesnt work after that. My current problem (which i dont think is too hard to solve this time though) is that once the picture is cropped, the cropping tool cant track the new coordinates so it can not crop a second time. This comes partly from taking the simple incremental route, when if everything was always calculated it would probably have the right coord's already.

Also, does that book contain any information on 3d shading techniques? I had to resort to complicated 3d analytic geometry for my 3d drawing program because i didnt have any good books on the subject yet. All the books i have gotten in the past were on math, electrical circuits, and physics and engineering.

Last edited: Mar 30, 2015
13. ### zulfi100 Thread Starter Member

Jun 7, 2012
320
0
Hi,
Thanks for your reply. I would try to concentrate more on what you said but i dont find any trouble in understanding uz where u= (a, b, c) . Thus uz = (0, 0, c). Any way yours notation uz = (0, 0, 1) also seems logical. For your ease, I am again telling you the things which are going over my head and which are clear to me:
The above is (clear to me).
The unit vector is clear to me but I dont know why we need this unit vector?
Its clear to me that d is the magnitude but why are we considering b & c only? we are in the xz plane. In my view d should be
d= sqrt (a2 + c2)

I understand that we are doing later part i.e. rotate the rotation axis so that it lies in the xz plane
I cant understand how we got the projection of rotation axis in yz plane and why we need to find the projection of rotation axis in the yz plane

A Programming Approach" by Steven Harrington. It discusses some shading algorithms. And yes the book from which i provided you the scanned pages (i dont know if you saw them), it has chapter 14 devoted to "Illumination Models and Surface Rendering Methods". I thing you should use the link which i provided you earlier. You search this title and surely you would get many power point material and even YoU-tube material. Actually in our country youtube is banned.

Thanks for your help. I am not able to understand only step 2 & step 3. I would soon update you about my problem.

Zulfi.

14. ### zulfi100 Thread Starter Member

Jun 7, 2012
320
0
Hi,
I have derived the cosine and sine for angle ∝ value:

Then

Cos ∝ = (0, b, c) . (0, 0, 1) / sqrt (b. b + c.c) . (0.0 + 0.0 + 1.1)

= c/ d
and sine ∝ is given by:
U’ x Uz=Ux |U’| |Uz| sin (Note : I am not able to figure out why there is Ux)

Also

U’ x Uz =Ux . b

Equating the right sides of the above equations:

Ux |U’| |Uz| sin = Ux . b

Ux would be eliminated from both sides, |U’|=d & |Uz|=1

d sin = b

sin = b/d

But again I cant understand the following statement from the book which is about angle :

Yes, you are right. This is a storage problem. This is more a programming problem. Over here programming is not given much importance. So i can do it personally when i have time which is difficult because things keep changing.

Zulfi.

Last edited: Mar 30, 2015
15. ### MrAl Distinguished Member

Jun 17, 2014
2,573
521
Hi again,

They had shown Ux (which we are taking to mean u sub x again) like that i guess so as to point out the unit normal, to show what direction it is in, when usually this would be implied, not written out directly like that. So we'd see (for two arbitrary u and v):
|u|*|v|*sin(Theta) n_hat
So they are telling you the direction already with the notation Ux rather than making you figure it out from the other variables.
In this case we should have Ux=[1,0,0], and that must be because of y and z forming a plane.

Yeah i have to put some more effort into the program of mine i guess. It's about 95 percent done but still more to be done. It was a chore to go from the first program to the second because it was almost an entire rewrite. The first program did not have to worry about the size of the bitmap surface, while with the new graphics card, it wont accept bitmap surfaces over a certain size. This is very puzzling because it has much more memory built in (like 2GB compared to the old 500MB). I would have thought it could handle BIGGER bitmaps without the need to temporarily crop before display, which is what i have to do now.

Last edited: Mar 31, 2015
16. ### zulfi100 Thread Starter Member

Jun 7, 2012
320
0
Hi,
I am trying to find cos β. I am stuck at this point:

cos β = U” . Uz/ |U”| |Uz|

= (a, 0, d) . (0, 0, 1) / |(a, 0, d) | |(0, 0, 1)|

= d / sqrt (a2 + d2)

Somebody please guide me, what to do next?

Zulfi.

17. ### MrAl Distinguished Member

Jun 17, 2014
2,573
521
Hello again,

Recall that the norm of a unit vector is always 1. The unit vector is [a,b,c], and the norm is sqrt(a^2+b^2+c^2).
Now in the denominator we have to calculate the norm of [a,0,d] times the norm of [0,0,1], and the norm of [0,0,1] is just 1, so next we have to calculate the norm of [a,0,d].

Since d=sqrt(b^2+c^2), we need to calculate:
sqrt(a^2+0^2+(b^2+c^2))

and as you can see this is equal to:
sqrt(a^2+b^2+c^2)

which is the same as the norm of the original unit vector [a,b,c] so it must equal 1.

Thus in the denominator we get 1, and in the numerator we get d, so the final result is d, so we have:
cos(Beta)=d

Last edited: Apr 1, 2015
18. ### zulfi100 Thread Starter Member

Jun 7, 2012
320
0
Hi,
Indeed I knew this fact but it was beyond my thinking that i should apply it in that way to make the denominator 1. You have brought a great relieve to me. Though I am able to understand the two tough problems mathematically but still some problems are left. In addition to this i have to solve some related examples.

Zulfi.

19. ### zulfi100 Thread Starter Member

Jun 7, 2012
320
0
Hi my friend,
I forgot to tell you. My book has following topics on shading:

If you need scanning of any one/all of these topics please let me. Are you looking for any specific topic??

Zulfi.

20. ### MrAl Distinguished Member

Jun 17, 2014
2,573
521
Hello again,

Oh thanks. What is the simplest possible 3d shading idea they give in the book, and is it one or two pages or a whole chapter?