Problems understanding headings for 3d rays

  • Thread starter cam875
  • Start date
  • Tags
    3d Rays
In summary, the conversation discusses the use of headings for 3D rays and how they differ from 2D. It is explained that in 3D, headings can be described with two angles, θ and ϕ, which act like latitude and longitude on a sphere. The formulas for converting between spherical and Cartesian coordinates are also discussed, using trigonometry. The conversation also touches on the use of sin, cos, and tan, which are defined in terms of ratios of the quantities being discussed.
  • #1
cam875
228
0
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
 
Physics news on Phys.org
  • #2
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.
 
  • #3
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?
 
  • #4
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.
 
  • #5
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
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?
 
  • #7
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.
 
  • #8
so your saying that if you traveled 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
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).
 
  • #10
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 I am starting to wonder where did sin cos and tan come from and how do they actually work in 2D because i don't really just like using them without understanding them.
 
  • #11
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
alright thanks for the info, ill check that link out.
 
  • #13
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.
pl4ERWMC.thumb.png

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.
 
  • #14
ok i wrote a computer program using what i learned from here and I am hoping its now correct. It tells me that if I traveled with a heading of 45 degrees on the x-y plane and 45 degrees on the z plane or w.e u want to call it for a distance of 1 from (0,0,0) i end up at (0.707, 0.707, 0.707) I am hoping that that is correct.
 
  • #15
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).
 
  • #16
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
cam875 said:
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 ϕ
 
  • #18
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.
 

1. What are 3D rays?

3D rays are a type of mathematical representation of a line in three-dimensional space. They are used in computer graphics and 3D modeling to describe the direction and position of a line or ray in a 3D environment.

2. Why do people have trouble understanding headings for 3D rays?

Understanding headings for 3D rays can be challenging because it involves visualizing objects in three-dimensional space, which can be difficult for some people. Additionally, the mathematical concepts and terminology used in 3D ray representation may be unfamiliar to those who are not well-versed in geometry or computer graphics.

3. How are headings for 3D rays different from traditional headings?

Traditional headings are typically used to describe the direction and position of a line or object in two-dimensional space. Headings for 3D rays, on the other hand, involve an extra dimension and require more complex calculations and visualizations.

4. What are some tips for understanding headings for 3D rays?

One helpful tip is to visualize the 3D ray as a line extending from a starting point in three-dimensional space. It may also be helpful to break down the calculations and understand each component of the heading separately, such as the angle of rotation and the direction of the ray.

5. How are 3D rays used in scientific research?

3D rays are used in a variety of scientific fields, including computer graphics, physics, and engineering. They are often used to model and simulate complex systems and phenomena, such as light rays in optics or the movement of particles in a fluid. 3D rays are also used in virtual reality and video game development to create immersive 3D environments.

Similar threads

Replies
2
Views
3K
  • Sci-Fi Writing and World Building
Replies
1
Views
522
Replies
2
Views
358
Replies
6
Views
2K
  • DIY Projects
Replies
4
Views
2K
  • High Energy, Nuclear, Particle Physics
Replies
1
Views
825
Replies
1
Views
776
  • High Energy, Nuclear, Particle Physics
Replies
6
Views
1K
Back
Top