Register to reply

3D rays

by cam875
Tags: rays
Share this thread:
cam875
#1
Nov21-08, 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
Phys.Org News Partner Science news on Phys.org
Experts defend operational earthquake forecasting, counter critiques
EU urged to convert TV frequencies to mobile broadband
Sierra Nevada freshwater runoff could drop 26 percent by 2100
adriank
#2
Nov21-08, 05:22 PM
P: 534
You can describe a direction in 3D with two angles θ and ϕ, with θ being the angle from the z-axis, and ϕ being an angle in the xy-plane. 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.
cam875
#3
Nov21-08, 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 x-y plane it is 0 degrees and the object travels 1m in that direction how do you figure out its new x,y,z co-ord. If you think about it the object would travel straight up but how can you prove this?

adriank
#4
Nov21-08, 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 z-axis? 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 z-axis is 0 (i.e. it is parallel to the z-axis), you have ‖d‖ = d k = dz (where k is your unit vector in the z-axis), 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 ϕ
y = r sin θ sin ϕ
z = r cos θ
from which you would get x = 0, y = 0, and z = 1.
HallsofIvy
#5
Nov21-08, 06:46 PM
Math
Emeritus
Sci Advisor
Thanks
PF Gold
P: 39,568
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".
cam875
#6
Nov21-08, 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 co-ord should be (0.5,0.5) right? but when you do the trig it gives you (0.707,0.707) which one is right?
adriank
#7
Nov21-08, 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 z-axis, and ϕ is the angle you get in the xy-plane by projecting r onto the xy-plane. (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 xy-plane, 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.
cam875
#8
Nov22-08, 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.
adriank
#9
Nov22-08, 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 y-axes 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).
cam875
#10
Nov22-08, 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.
HallsofIvy
#11
Nov23-08, 05:48 AM
Math
Emeritus
Sci Advisor
Thanks
PF Gold
P: 39,568
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/
cam875
#12
Nov23-08, 07:37 AM
P: 230
alright thanks for the info, ill check that link out.
eee3
#13
Nov30-08, 10:48 AM
P: 2
Wha, that wikipedia-pic sure was confusing.
This one that is easier to understand, not using the same axis-system though, just rename x/y/z if you find it confusing.

The big blue dot is a point in the 3d-space. The big black dot is a point on the XZ-plane straight below the 3d-point.
Now you can easily see that it simply consists of two 2d-triangles, one blue and one red. The length of b is simply found by using trig on the blue triangle, that's why adriaks formulas for x and y have two trig-terms while z only has one:
x = r sin θ cos ϕ
y = r sin θ sin ϕ
z = r cos θ
Note again that it's not the same coordinate system.
cam875
#14
Dec5-08, 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 x-y 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.
adriank
#15
Dec5-08, 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 ϕ
y = r sin θ sin ϕ
z = r cos θ
you get (0.5, 0.5, 0.707).
cam875
#16
Dec5-08, 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.
eee3
#17
Dec8-08, 10:31 AM
P: 2
Quote Quote by cam875 View Post
but why is there 2 different trigonometric calculations involved in the x and y part.
Image 2 posts up ^^

The length of the hypotenuse for the XY-plane-triangle 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 ϕ
adriank
#18
Dec8-08, 11:07 AM
P: 534
Also, the Pythagorean Theorem has to hold as well: x2 + y2 + z2 = r2.

x2 + y2 + z2
= (r sin θ cos ϕ)2 + (r sin θ sin ϕ)2 + (r cos θ)2
= r2 sin2 θ cos2 ϕ + r2 sin2 θ sin2 ϕ + r2 cos2 θ
= r2 (sin2 θ (cos2 ϕ + sin2 ϕ) + cos2 θ)
= r2 (sin2 θ + cos2 θ)
= r2.

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 X-rays 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