POV-Ray : Newsgroups : povray.general : Looking for a formula Server Time
29 Jul 2024 12:25:27 EDT (-0400)
  Looking for a formula (Message 6 to 15 of 35)  
<<< Previous 5 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: scott
Subject: Re: Looking for a formula
Date: 12 Feb 2013 10:43:23
Message: <511a631b@news.povray.org>
> 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

From: Samuel Benge
Subject: Re: Looking for a formula
Date: 12 Feb 2013 11:20:00
Message: <web.511a6aee24d8606eb6b777fb0@news.povray.org>
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

From: Stephen
Subject: Re: Looking for a formula
Date: 12 Feb 2013 14:47:05
Message: <511a9c39$1@news.povray.org>
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

From: Christian Froeschlin
Subject: Re: Looking for a formula
Date: 12 Feb 2013 15:22:51
Message: <511aa49b$1@news.povray.org>
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

From: Stephen
Subject: Re: Looking for a formula
Date: 12 Feb 2013 15:35:07
Message: <511aa77b$1@news.povray.org>
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

From: Trevor G Quayle
Subject: Re: Looking for a formula
Date: 12 Feb 2013 17:00:01
Message: <web.511ababf24d8606ed025e8e00@news.povray.org>
Stephen <mca### [at] aolcom> wrote:
> 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

The x & y axis intersect because they are both on the same plane (x-y plane with
z as the normal), similar for the y & z and x & z.  So yes they are co-planar.

-tgq


Post a reply to this message

From: Alain
Subject: Re: Looking for a formula
Date: 12 Feb 2013 20:54:41
Message: <511af261$1@news.povray.org>

> 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?
>
>
The X and Y axis are coplanar, so are X and Z and Y and Z, it's just 
that they don't share the same planes.

Any 2 lines that intersect are always coplanar, but any 3 or more 
intersecting lines are not always coplanar relative to the same plane. 
Each pair of lines can define different planes.

Next, any pair of parallel lines are also always coplanar.

Finaly, you have non-parallel lines that don't intersect.

The mention of using a very thin cylinder to represent one line and 
using the trace function is interesting. A returned normal of <0,0,0> 
indicating non-intersecting lines that MAY be parallel. Replacing the 
target line by a plane WILL result in false positives in the case of 
non-coplanar lines.



Alain


Post a reply to this message

From: MichaelJF
Subject: Re: Looking for a formula
Date: 13 Feb 2013 13:55:01
Message: <web.511be14924d8606e1f9f19000@news.povray.org>
I'm puzzled totaly. Are you the same Holger Karsten who posted a windmill robot
flying around a backyard with Povray-renderings copyied in front of a real
video? Or are you an other person? If you are, you should be able to solve this
simple linear algebra issue. If you are not, you have a clone here.

Best regards,
Michael


Post a reply to this message

From: BertvdB
Subject: Re: Looking for a formula
Date: 14 Feb 2013 15:00:01
Message: <web.511d419224d8606ed25d21bf0@news.povray.org>
Catch the first line in a formula and then the second. Then some algebraic magic
you'll find the intersection no matter how many dimensions you're dealing with.
The clou is If formula1=formula2, you have the intersection.


Post a reply to this message

From: Kenneth
Subject: Re: Looking for a formula
Date: 14 Feb 2013 16:05:01
Message: <web.511d4ff224d8606ec2d977c20@news.povray.org>
"Samuel Benge" <stb### [at] hotmailcom> wrote:

> scott <sco### [at] scottcom> wrote:
> > ...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.

I guess this assumes that the two lines DO lie on the same plane.

But wouldn't using trace() require essentially an infinite number of trace
points, so that trace doesn't 'miss' the intersection? Or is it an iterative
approach--i.e., when the returned trace point is 'close' to the target spot,
then trace is used again, but restricted to that smaller vicinity (and so on)? I
can see that working successfully, to a certain precision; but it doesn't seem
possible to find the *exact* point of intersection (without infinite trace
rays.) In a practical sense, though, an exact match might not be necessary.


Post a reply to this message

<<< Previous 5 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.