|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hi people :)
I have two lines and like to have there intersection-point.
Like
<Line_1_Start_X,Line_1_Start_y> to <Line_1_End_X,Line_1_End_Y>
and
<Line_2_Start_X,Line_2_Start_y> to <Line_2_End_X,Line_2_End_Y>
And I like to get <Intersection_X,Intersection_Y>
Is there any formula, coming with the PovRay-Inc-Files, like Math.inc, I can
use?
Or does someone have a quick way to solve this?
Tanx,
Holger :)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 2/11/2013 6:15 PM, H. Karsten wrote:
> Hi people :)
> I have two lines and like to have there intersection-point.
>
> Like
> <Line_1_Start_X,Line_1_Start_y> to <Line_1_End_X,Line_1_End_Y>
> and
> <Line_2_Start_X,Line_2_Start_y> to <Line_2_End_X,Line_2_End_Y>
>
> And I like to get <Intersection_X,Intersection_Y>
>
> Is there any formula, coming with the PovRay-Inc-Files, like Math.inc, I can
> use?
>
> Or does someone have a quick way to solve this?
>
> Tanx,
> Holger :)
>
>
>
>
http://mathworld.wolfram.com/Line-LineIntersection.html
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
FlyerX <fly### [at] yahoocom> wrote:
> >
> http://mathworld.wolfram.com/Line-LineIntersection.html
That looks...complicated :-O
But seeing the diagram there gave me a thought: The problem looks like it might
be solvable by a strictly geometric method instead (triangles, angles, etc.)--
something that might be more conceptually easy to code into SDL. I sat down
with pencil and paper and worked on it for awhile (resulting in lots of
crumpled-up paper!) But one particular method looks promising. If it pans out,
I'll post it.
I imagine the ancient Greeks might have given this problem a fair amount of
thought.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Kenneth <kdw### [at] gmailcom> wrote:
> > http://mathworld.wolfram.com/Line-LineIntersection.html
> That looks...complicated :-O
Understanding where the intersection comes from can be complicated, even
though the formula itself is often relatively short.
The formula you are looking for is probably (24) on that page. (It certainly
looks familiar. I have dealt a lot with basic geometry in the past.)
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
FlyerX <fly### [at] yahoocom> wrote:
> On 2/11/2013 6:15 PM, H. Karsten wrote:
> > Hi people :)
> > I have two lines and like to have there intersection-point.
> >
> > Like
> > <Line_1_Start_X,Line_1_Start_y> to <Line_1_End_X,Line_1_End_Y>
> > and
> > <Line_2_Start_X,Line_2_Start_y> to <Line_2_End_X,Line_2_End_Y>
> >
> > And I like to get <Intersection_X,Intersection_Y>
> >
> > Is there any formula, coming with the PovRay-Inc-Files, like Math.inc, I can
> > use?
> >
> > Or does someone have a quick way to solve this?
> >
> > Tanx,
> > Holger :)
> >
> >
> >
> >
> http://mathworld.wolfram.com/Line-LineIntersection.html
Since you are dealing with lines in 3-space (x,y,z), the lines will only
intersect if they lie on the same plane. Otherwise, the best you can do is find
the closest point.
-tgq
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> But seeing the diagram there gave me a thought: The problem looks like it might
> be solvable by a strictly geometric method instead (triangles, angles, etc.)--
...or do it numerically by using the trace function. You could define
one of the lines as a very thin cylinder, then do a trace from the start
point of the 2nd line towards its end point.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
scott <sco### [at] scottcom> wrote:
> > But seeing the diagram there gave me a thought: The problem looks like it might
> > be solvable by a strictly geometric method instead (triangles, angles, etc.)--
>
> ...or do it numerically by using the trace function. You could define
> one of the lines as a very thin cylinder, then do a trace from the start
> point of the 2nd line towards its end point.
Or for more accuracy, make one line a plane. Use VPerp_To_Vector or
Point_At_Trans to align the plane along the line and translate it to one of its
endpoints. Then use trace(). I do that every time I need to find a line
intersection and it works perfectly. Also, using trace()'s fourth parameter
helps make sure you get an intersection: if the ray hits nothing (the normal is
<0, 0, 0>) then just reverse its direction.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 12/02/2013 1:47 PM, Trevor G Quayle wrote:
> Since you are dealing with lines in 3-space (x,y,z), the lines will only
> intersect if they lie on the same plane.
Can that be right?
What about the lines of the three axis?
--
Regards
Stephen
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Stephen wrote:
>> Since you are dealing with lines in 3-space (x,y,z), the lines will only
>> intersect if they lie on the same plane.
> Can that be right?
take two pens, and you will find you can easily hold them
so that they do not intersect, are not parallel, and with the
point of closest approach clearly within the physical pen
boundaries (and not just their projection to infinity).
> What about the lines of the three axis?
any two axes lie within a plane and intersect at the origin.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 12/02/2013 8:22 PM, Christian Froeschlin wrote:
> Stephen wrote:
>
>>> Since you are dealing with lines in 3-space (x,y,z), the lines will only
>>> intersect if they lie on the same plane.
>
>> Can that be right?
>
> take two pens, and you will find you can easily hold them
> so that they do not intersect, are not parallel, and with the
> point of closest approach clearly within the physical pen
> boundaries (and not just their projection to infinity).
>
Yes, that is true.
>> What about the lines of the three axis?
>
> any two axes lie within a plane and intersect at the origin.
And is the third axis, in 3D space, in the same plane as the plane of
the first two axis?
--
Regards
Stephen
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |