Jump to content

  • Log In with Google      Sign In   
  • Create Account

line segments having common endpoint


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 RJSkywalker   Members   -  Reputation: 162

Like
0Likes
Like

Posted 05 January 2013 - 06:44 PM

Hey guys,

 

 I had a question regarding 2 line segments. Say we have 2 line segments whose origin and lengths are given as: (P0, L0) and (P1, L1) respectively. I need to find when can they end at the same point. The line segments lie anywhere in 3D space.

 

One of the approaches I could think about is: Let's say this common end point is T and the points are A and B. So for the line segments with A and B as origins, A,B and T must form a triangle. Length of vector AT = L0 and length of vector BT = L1. But since the orientation of the line segment is not known, there can be a lot of possibilities. Lets say we choose a particular orientation for line segment AT as (i,j,k) - 1st octant. So now we can move anywhere in space  from T but only by a distance L1 to find BT. 

 

This is where I m not sure how to move forward. 



Sponsor:

#2 Nypyren   Crossbones+   -  Reputation: 4796

Like
0Likes
Like

Posted 05 January 2013 - 07:46 PM

Sounds like you just want the sphere/sphere intersection(s) (or circles if you're in 2D).

http://en.wikipedia.org/wiki/Sphereâsphere_intersection

http://mathworld.wolfram.com/Circle-CircleIntersection.html

Edited by Nypyren, 05 January 2013 - 07:48 PM.


#3 Álvaro   Crossbones+   -  Reputation: 13905

Like
0Likes
Like

Posted 05 January 2013 - 07:51 PM

If you just want to know whether a solution exists or not, you just have to check the triangle inequalities. Define d = distance(P0, P1). Then there is a solution if and only if d <= L0+L1 and d >= abs(L0-L1).



#4 RJSkywalker   Members   -  Reputation: 162

Like
0Likes
Like

Posted 05 January 2013 - 09:03 PM

@Alvaro:

Thanks for the d >= abs(L0-L1) info.. I had figured out the L0+L1 part. Both of these would give if a solution exists or not. But I also want to know the configuration of the 2 line segments, as in also the point as well. I want my function to return a list of all such points. Because if I think of a brute force way, I can find atleast 3 points by moving by L0 parallel to  the 3 axes. The other points can be found by breaking L0 into x,y and z components if I am write. So if i have to iterate through a loop, how can I find the range of the loop it does not exactly go on a particular order when finding the point. 



#5 EWClay   Members   -  Reputation: 659

Like
0Likes
Like

Posted 06 January 2013 - 04:59 AM

There is an infinite number of such points, forming a circle. You won't be able to return a list of them unless you constrain the solution further.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS