The reverse operation for the dot product?

In summary: I can't quite figure it out.In summary, the problem at hand involves finding an equation or method to specify an angle theta and a 3D line, and obtain the 3D coordinates of points on the line that make the angle theta with the origin and
  • #1
cawthorne
7
0
Okay. First off. This isn't homework. I have been working on a personal project and if I could get an equation for this it would really help me out. I'll try and explain the problem the best I can.

What I need:

An equation/method where I can specify an angle theta and a 3D line and it returns the 3D coordinates of the points on the line which make the angle theta with the origin and the point (1, 0, 0).

The problem:
You have a 3D graph with origin O. The positional vector A with coordinates (1, 0, 0) and another position vector B. You could use the dot product function to work out the angle AOB, if you had B. But you don't.

Dot Product function:

cos(theta) = A.B/(|A|*|B|)

You also know that B is somewhere on the 3D line r = (x, y, z) + lambda(a, b, c), where lambda is proportional to the displacement from (x, y, z) and (a, b, c) is the 3D gradient. This line can also be represented as a Cartesian line equation in the form x=y=z (but some other co-efficients etc.) e.g it could be 2x=5-y=(3z-2)/4.
I want to specify an angle theta between BOA and work out position vector of A and the position vector of equation of the line B rests on. O will always have coordinates (0, 0, 0), but that doesn't mater as it's just a point of relevance.

Also, it i worth mentioning that there may well be two solutions for B for a given angle theta if the line cuts through the angle twice, or one or no solutions. Actually come to think of it it could have infinite solutions if theta was 90 degrees (Point 90 degrees from the vector (1, 0, 0) are on the plane x = 0, because this is a flat plane, as a pose to a cone shape (the one value of theta where this happens), if the x coordinate of every point line r is also always equal to 0, then there will be infinite solutions).
I like to think about the angle as a cone with the tip at the origin, (where every point on the surface of the cone is theta degrees away from the origin).

Ramblings of a mad man:

I have defined the function dotProduct (3DVector), which returns the angle AOB, when B is the parameter.

The only things that I could work out are that for very large values of lambda in the line r the coordinate tends towards being a multiple of (a, b, c) (3D gradient), as the (x, y, z part gets infinitely small by comparison). And so the coordnate (a, b, c) can be treated as B if lambda is infinitely large. So we can do dotProduct((a, b, c)), which returns the same angle as though B where (a, b, c).

Also I was thinking this:

If you take the line r2 = (0, 0, 0) + lambda*(a, b, c). As in a line with the same gradient as r, but goes through the origin. Then the point on the line r, which is perpendicular to the line r2 through the origin point, is the closet to the origin the line r will get and if we treat that point as B then theta will be within 90 degrees +- the acute angle a point on the line r2 makes with A and O. And since r2 goes through the origin, there are only two angles any point on the line r2 can make with A and O (on acute one when the point is less than 90 degrees and one obtuse one it is over 90 degrees).

The reason why I need this is because I have made a 3D engine, which takes into account perspective and that distortion effect you get when you take a panoramic photo with a large angle of view. To do the distortion effect I am just sampling the 3D line in 3D space very often and joining them with straight lines, but movement 3D space is only proportional to movement in the 2D rendering in very specific directions/positions relative to the camera. I have made it o it only samples as often as it need to (less when it is less distorted, more when it is more distorted etc.), but it would be a big help if I can figure out how to do this reverse dot product, because it will mean I can start rendering at the edge of a certain field of view, which will get rid of a lot of redundant computations.

Thanks for any help guys. I'd really appreciate.

Reagrds, Greg.

P.S. - If this is the wrong section, please say. [STRIKE]I will be happy to repost it elsewhere.[/STRIKE]
<< Mentor Note -- Use the Report button to ask the Mentors to move it >>
 
Last edited by a moderator:
Mathematics news on Phys.org
  • #2
For each lambda, you have a known point r. You can calculate the angle α you get with that value of lambda, and solve the resulting equation (with the fixed angle) for lambda.
You will get some special cases during the solution process, which correspond to "all lambdas are a solution" and similar things.
 
  • #3
mfb said:
For each lambda, you have a known point r. You can calculate the angle α you get with that value of lambda, and solve the resulting equation (with the fixed angle) for lambda.
You will get some special cases during the solution process, which correspond to "all lambdas are a solution" and similar things.

r = (x, y, z)+ lambda*(a, b, c)

where x, y, z, a, b, c are know and lambda is known.

let's say we want r when alpha = 80 degrees

Okay so we have the equation alpha = acos(((x+ lambda*a, y + lambda*b, z + lambda*c).(1, 0, 0))/(((x+ lambda*a)^2 + (y+ lambda*b)^2 + (z + lambda*c)^2)^(0.5))*(1^2 + 0^2 + 0^2)^0.5))

(1^2 + 0^2 + 0^2)^0.5) = 1, so alpha = acos(((x+ lambda*a, y + lambda*b, z + lambda*c).(1, 0, 0))/(((x+ lambda*a)^2 + (y+ lambda*b)^2 + (z + lambda*c)^2)^(0.5)))

since wee're using (1, 0 , 0), we only need to consider the x component of r for the dot product, so alpha = acos((x+ lambda*a)/(((x+ lambda*a)^2 + (y+ lambda*b)^2 + (z + lambda*c)^2)^(0.5)))

Then I try to rearrange and get stuck

cos^2(alpha) = (x^2 + 2*lambda*x*a + (lambda*a)^2)/((x+ lambda*a)^2 + (y+ lambda*b)^2 + (z + lambda*c)^2)

If you can rearrange that for lambda I would be very grateful! My maths skills don't seem to be up to it :).
 
Last edited:
  • #4
Hi, cawthorne,
you are doing fine so far. You expanded the square in the numerator of the fraction, and eventually you will have to expand also the three squares in the denominator. This could be done now, or a bit later.

The important next step is to notice that cos^2(alpha) is just a constant, because alpha is given. You can pass the whole denominator multiplying to the left side. Then distribute the constant cos^2(alpha), and then expand the squares as you did before.

Finally you will be able to group the terms in lambda^2, in lambda and with no lambda, to find a solution of a quadratic equation. (You will see when you get there.)
 
  • #5
Ahhh silly me :P. I did think it might have been a quadratic thing, but I got lost in all the extra terms (which I knew already!) :P.

Thanks!
 
  • #6
cawthorne said:
Ahhh silly me :P. I did think it might have been a quadratic thing, but I got lost in all the extra terms (which I knew already!) :P.

Thanks!

By "I knew already" I meant that the extra terms where the input variables (constants for each given 3D vector), so I was silly to have been confused by them :P. Sometimes it's the easy parts which get you :P.
 

FAQ: The reverse operation for the dot product?

1. What is the reverse operation for the dot product?

The reverse operation for the dot product is the cross product.

2. How is the reverse operation for the dot product different from the dot product?

The dot product is a scalar quantity, while the reverse operation, the cross product, is a vector quantity. This means that the dot product results in a single value, while the cross product results in a vector with magnitude and direction.

3. What are the mathematical representations for the reverse operation of the dot product?

The mathematical representations for the reverse operation of the dot product are the vector cross product notation (A x B) and the determinant notation (|A| |B| sinθ).

4. What are the properties of the reverse operation for the dot product?

The reverse operation for the dot product is anticommutative, meaning that A x B = -B x A. It is also distributive, meaning that A x (B + C) = (A x B) + (A x C). Additionally, it follows the right-hand rule, where the direction of the resulting vector is perpendicular to both A and B in a clockwise direction.

5. How is the reverse operation for the dot product used in physics and engineering?

The reverse operation for the dot product is commonly used in physics and engineering to calculate torque, angular momentum, and magnetic force. It is also used in vector calculus to solve problems related to surfaces, volumes, and motion in three-dimensional space.

Similar threads

Replies
4
Views
3K
Replies
4
Views
2K
Replies
20
Views
1K
Replies
7
Views
2K
Replies
5
Views
1K
Replies
4
Views
1K
Back
Top