Locating points on rays given distance bw them

Started by
21 comments, last by gondar 14 years, 7 months ago
I have three rays defined by an origin point O and three direction vectors Va, Vb, Vc. There are three points A, B and C, each one is located somewhere on a separate ray. I know distance between points A, B and C and I have to find exact position of points A, B and C. |Va| = |Vb| = |Vc| = 1 T1 = |OA| T2 = |OB| T3 = |OC| I'm unable to find a solution thus far. [Edited by - gondar on September 13, 2009 7:41:50 AM]
Advertisement
I think it misses some info to reach one solution. For instance is OC perpendicular to AB?

Is the |angle COB| the same as |angle COA|
Ron AF Greve
Quote:Original post by szecs
Yes, the problem is over or under constrained.
If the rays are given too, then it's over, if not, under.
It can be solved, if two rays, and the three sides are given.
Or 3 rays, and two sides -> so 5 params need to be given.

If 3 rays and 3 sides, the problem is solvable only in special cases, in general cases, no, because 5 params will define the geometry perfectly, and in general, the 6th will be in conflict with the others.


The variables marked as blue are given:
1. Distance between points A, B, C is known
2. Origin point O for the rays is known
3. Direction vectors for rays are known

If problem is either over or under constrained, can you prove it?
Sorry deleted the post, I was wrong
If I have understood correctly its not too hard. Lets take triangle OAB. We know all inner angles and |AB|. We know the angles becase we know vectors, so we just need to take dot product to obtain angles. Than just take sine law and calculate remaining distances |OA| and |OB|. Than make your vectors unit vectors and multiply them with distances |OA| and |OB| to obtain points A and B.
For point C calculate the point between A and B, lets call it D. Since you also know all the angles in triangle ABC and all the distances its easy to find point C. Now just add point C to D and u have real C.
I hope it makes sense without a drawing:

'a','b','c' is the angle at A,B,C points
'x' is the angle of O-B-A, 'y': O-A-B (middle is the "corner").
't' is angle between Va-Vb rays.

equations:

(180-(180-b-x)-x) + (180-(180-a-y)-y) + c =180
t+x+y=180

solve this, and you'll have 'x' and 'y', so you are able to calculate all angles in the geometry.
Then let O-A length be 1, calculate one side, it will be for example 'G1_mod'.
You have to scale with G1_mod/G1, and you got the real O-A distance.

Finding an easier solution, well, I'm not capable of that.

Some help to draw it: draw a line that goes through C and parallel to A-B.
EDIT2: (180-b-x) is the angle between B-C and Vb, (180-a-y) between A-C and Va.

This works only for the situation, you have drawn (Va,Vb,Vc in this order, and C is outside the O-A-B triangle).

EDIT: findig a general solution is f. hard, maybe easier to simply handle all the possible situations.
BTW, there are 2 solutions to the problem (C is inside or outside)



EDITX: Sorry doesn't work,
(180-(180-b-x)-x) + (180-(180-a-y)-y) + c =180 becomes a+b+c=180, so no extra info, (was a nice try anyway...)
SORRY!

[Edited by - szecs on September 13, 2009 7:50:04 AM]
Quote:Original post by ryt
If I have understood correctly its not too hard. Lets take triangle OAB. We know all inner angles and |AB|. We know the angles becase we know vectors, so we just need to take dot product to obtain angles. Than just take sine law and calculate remaining distances |OA| and |OB|. Than make your vectors unit vectors and multiply them with distances |OA| and |OB| to obtain points A and B.
For point C calculate the point between A and B, lets call it D. Since you also know all the angles in triangle ABC and all the distances its easy to find point C. Now just add point C to D and u have real C.


Triangle OAB is not necessarily a right-angled one.

While we clearly can find angle <AOB, since we know normalized OA and OB vectors (the ray direction vectors Va, Vb), it doesnt seem apparent that we know all the inner angles of OAB and thus we can't use the law of sines here.

Please elaborate.
Quote:Original post by szecs
I hope it makes sense without a drawing:

'a','b','c' is the angle at A,B,C points
'x' is the angle of O-B-A, 'y': O-A-B (middle is the "corner").
't' is angle between Va-Vb rays.

equations:

(180-(180-b-x)-x) + (180-(180-a-y)-y) + c =180
t+x+y=180

solve this, and you'll have 'x' and 'y', so you are able to calculate all angles in the geometry.
Then let O-A length be 1, calculate one side, it will be for example 'G1_mod'.
You have to scale with G1_mod/G1, and you got the real O-A distance.

Finding an easier solution, well, I'm not capable of that.

Some help to draw it: draw a line that goes through C and parallel to A-B.
EDIT2: (180-b-x) is the angle between B-C and Vb, (180-a-y) between A-C and Va.

This works only for the situation, you have drawn (Va,Vb,Vc in this order, and C is outside the O-A-B triangle).

EDIT: findig a general solution is f. hard, maybe easier to simply handle all the possible situations.
BTW, there are 2 solutions to the problem (C is inside or outside)


What do you mean by angle a, b, c? Do you mean <CAB <ABC <ACB?

Alright, we can indeed find angles <CAB <ABC <ACB by using law of cosines.

But that's when i lose the thread.

You're in effect saying that 180 - <ABC - <OBA = <OBC? Or in other words <ABC + <OBA + <OBC = 180? Is that correct? It doesn't seem right to me though. Please elaborate.

----
It's true that there are two correct solutions, but in this case we can easily assume that T1 > 0, T2 > 0, T3 > 0.
Read back, I was wrong.
It's a fucking hard problem.
Last idea: if you don't have to calculate it precisely, or in real time, you could use iteration:
Assume the C point, then shoot 2 rays from it (their angle should be 'c', the angle in the C point in the triangle), then calculate the A'-C' and B'-C' sides of the triangle, if their ratios A'C'/B'C' differ from the ratios of the given triangle AC/BC, you have to shoot another rays and repeat the procedure again and again, until the difference reaches a small, acceptable value.
For example, if AB'/BC' greater than the given AC/BC, you have to rotate the rays (from C) clockwise, if less, counterclockwise, if equal, than quit the iteration.

You have to rotate the rays with a decreasing absolute value in the new iteration steps, to avoid infinite loops. Meaning new angle of rays=old angle of rays + increment or decrement value

This way, you will have all the angles in the geometry.

To get O-A distance, let O-A' be 1 long. Calculate A'C', then the real O-A = AC/A'C'.
The same for the other distances.

This topic is closed to new replies.

Advertisement