Register to reply 
3D raysby cam875
Tags: rays 
Share this thread: 
#1
Nov2108, 04:16 PM

P: 230

Im having problems understanding headings for 3d rays. I mean with 2D you can have an object at (2,3) with a heading of 83 degrees. But in 3d you can have an object at (2,3,3) but how can you describe its heading, do you need two separate headings for the two planes, how does this work. Thanks in advance



#2
Nov2108, 05:22 PM

P: 534

You can describe a direction in 3D with two angles θ and ϕ, with θ being the angle from the zaxis, and ϕ being an angle in the xyplane. You can think of them as corresponding to latitude and longitude, which specify a location on a sphere, or equivalently a ray from the centre to a point on the sphere.
Together with a third coordinate r representing distance, you get the spherical coordinate system (r, θ, ϕ), which picks out a point in space just like the Cartesian (x, y, z) coordinate system. 


#3
Nov2108, 06:00 PM

P: 230

so if you have an object at (0,0,0) and its heading on the z plane is 0 degrees and on the xy plane it is 0 degrees and the object travels 1m in that direction how do you figure out its new x,y,z coord. If you think about it the object would travel straight up but how can you prove this?



#4
Nov2108, 06:21 PM

P: 534

3D rays
I'm not quite sure what you mean by the "z plane"; do you mean that its heading is at an angle of 0 degrees to the zaxis? In that case there are at least two ways you could approach the problem.
If your displacement vector is d, then if its angle to the zaxis is 0 (i.e. it is parallel to the zaxis), you have ‖d‖ = d · k = d_{z} (where k is your unit vector in the zaxis), so if ‖d‖ = 1, you must have d = (0, 0, 1). A second, more straightforward method is this: You know that your displacement vector in spherical coordinates is (r, θ, ϕ) = (1, 0, 0). Then you could transform from spherical coordinates to Cartesian coordinates: x = r sin θ cos ϕfrom which you would get x = 0, y = 0, and z = 1. 


#5
Nov2108, 06:46 PM

Math
Emeritus
Sci Advisor
Thanks
PF Gold
P: 39,339

Another way is to use the "direction angles", the angles the vector makes with with each of the axes, say [itex]\theta_x[/itex], [itex]\theta_y[/itex], [itex]\theta_z[/itex]. Of course there are three angles when, as said above[, you need only two, so those are not independent: for any vector, [itex]cos^2(\theta_x)+ cos^2(\theta_y)+ cos^2(\theta_z)= 1[/itex] so the components of a unit vector are just its "direction cosines".



#6
Nov2108, 07:00 PM

P: 230

ok, starting to make sense but how exactly did you figure out
x = r sin θ cos ϕ y = r sin θ sin ϕ z = r cos θ because x = 0, y = 0, and z = 1 is the exact answer and I want to know your method you used to figure out those formulas, and do you have to use trig? also, i have a question related to 2d math. If you consider a similar problem where an object lies at (0,0) and has a heading of 45 degrees and its distance is 1 than the new x,y coord should be (0.5,0.5) right? but when you do the trig it gives you (0.707,0.707) which one is right? 


#7
Nov2108, 08:32 PM

P: 534

You can derive the relations for spherical coordinates using some trigonometry. Wikipedia has them but unfortunately doesn't show a derivation; here's a rough sketch of how it works:
Let's say you have a vector r specified in spherical coordinates by (r, θ, ϕ), where r is the length, θ is the angle to the zaxis, and ϕ is the angle you get in the xyplane by projecting r onto the xyplane. (See the first figure on the Wikipedia article for an idea of what this looks like.) The dotted triangle has three sides: the vector r itself, the vertical side which has length z, and the bottom side being a vector that we'll call, say, r', with length r'. Trigonometry gives z = r cos θ and r' = r sin θ. Now this r' vector is entirely in the xyplane, and its x and y components are the same as those of r, so you end up with x = r' cos ϕ and y = r' sin ϕ. Putting r' = r sin θ gives the result. For your second question, (0.707, 0.707) is correct. If you check the length of (0.5, 0.5), you get about 0.707 by the Pythagorean theorem, not 1. 


#8
Nov2208, 05:35 PM

P: 230

so your saying that if you travelled 1 metre on a 45 degree angle you would travel 0.5 m on the x axis and the y axis or 0.707 m on the x and y axis because 0.5 m makes much more sense.



#9
Nov2208, 05:41 PM

P: 534

It would be 0.707 m.
If you move in a straight line such that your positions along the x and yaxes each change by 0.5 m, you will have traveled 0.707 m. If you first went 0.5 m in the x direction and then 0.5 m in the y direction, then yes, the distance you traveled would be 1 m, but the displacement from the original location would only be 0.707 m (because you didn't go in a straight line). 


#10
Nov2208, 07:36 PM

P: 230

ok I think i understand so if an object travels 1 m on a 45 degree angle from (0,0) it is now at (0.707, 0.707)?
now im starting to wonder where did sin cos and tan come from and how do they actually work in 2D cuz i dont really just like using them without understanding them. 


#11
Nov2308, 05:48 AM

Math
Emeritus
Sci Advisor
Thanks
PF Gold
P: 39,339

Hopefully you see that the x and y components of a vector of length 1 can't be 1/2 because of the Pythagorean theorem: (1/2)^{2}+ (1/2)^{2}= 1/4+ 1/4=1/2, not 1.
[tex]\left(\frac{\sqrt{2}}{2}\right)^2+ \left(\frac{\sqrt{2}}{2}\right)^2= \frac{2}{4}+ \frac{2}{4}[/tex] [tex]= \frac{1}{2}+ \frac{1}{2}= 1[/tex] As for "where sin cos and tan come from", they are DEFINED in terms of ratios of exactly the quantities you are talking about. Here's a nice little introduction: http://www.clarku.edu/~djoyce/trig/ 


#12
Nov2308, 07:37 AM

P: 230

alright thanks for the info, ill check that link out.



#13
Nov3008, 10:48 AM

#14
Dec508, 03:47 PM

P: 230

ok i wrote a computer program using what i learned from here and im hoping its now correct. It tells me that if I travelled with a heading of 45 degrees on the xy plane and 45 degrees on the z plane or w.e u wanna call it for a distance of 1 from (0,0,0) i end up at (0.707, 0.707, 0.707) im hoping that that is correct.



#15
Dec508, 05:35 PM

P: 534

No, it's not; you'd get a total length of [tex]\sqrt{(0.707)^2+(0.707)^2+(0.707)^2} = 1.225[/tex] by the Pythagorean theorem. If you put in r = 1 and 45 degrees for each of the angles in the equations
x = r sin θ cos ϕyou get (0.5, 0.5, 0.707). 


#16
Dec508, 05:43 PM

P: 230

that equation doesnt't make sense to me, the z part makes sense but why is there 2 different trigonometric calculations involved in the x and y part.



#17
Dec808, 10:31 AM

P: 2

The length of the hypotenuse for the XYplanetriangle is given by [Hypotenuse for the blue plane]*Cos(phi). So Hypotenuse_red = Hypotenuse_blue*Cos(phi) Therefore: x = Length_red = = Hypotenuse_red * Cos(gamma) = = [Hypotenuse_blue*Cos(phi)] * Cos(gamma) = = r cos θ cos ϕ 


#18
Dec808, 11:07 AM

P: 534

Also, the Pythagorean Theorem has to hold as well: x^{2} + y^{2} + z^{2} = r^{2}.
x^{2} + y^{2} + z^{2} = (r sin θ cos ϕ)^{2} + (r sin θ sin ϕ)^{2} + (r cos θ)^{2} = r^{2} sin^{2} θ cos^{2} ϕ + r^{2} sin^{2} θ sin^{2} ϕ + r^{2} cos^{2} θ = r^{2} (sin^{2} θ (cos^{2} ϕ + sin^{2} ϕ) + cos^{2} θ) = r^{2} (sin^{2} θ + cos^{2} θ) = r^{2}. Also, as a general note, observe that x and y depend on both angles, so they both better be in the equations for them. 


Register to reply 
Related Discussions  
Information on Xrays and Gamma Rays  Nuclear Engineering  2  
What's the difference between gamma rays and x rays?  General Physics  5  
UV Rays  General Physics  7  
What kinds of space rays are detectable on earth  Astronomy & Astrophysics  3 