# Locating points on rays given distance bw them

This topic is 3383 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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]

##### Share on other sites
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|

##### Share on other sites
Quote:
 Original post by szecsYes, 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?

##### Share on other sites
Sorry deleted the post, I was wrong

##### Share on other sites
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.

##### Share on other sites
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]

##### Share on other sites
Quote:
 Original post by rytIf 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.

##### Share on other sites
Quote:
 Original post by szecsI 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 =180t+x+y=180solve 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.

##### Share on other sites
Read back, I was wrong.
It's a fucking hard problem.

##### Share on other sites
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.

1. 1
2. 2
Rutin
19
3. 3
khawk
18
4. 4
5. 5

• 9
• 12
• 16
• 26
• 10
• ### Forum Statistics

• Total Topics
633769
• Total Posts
3013756
×