POV-Ray : Newsgroups : povray.advanced-users : For the math minded people Server Time
26 Nov 2024 11:49:32 EST (-0500)
  For the math minded people (Message 1 to 10 of 16)  
Goto Latest 10 Messages Next 6 Messages >>>
From: Fabien Hénon
Subject: For the math minded people
Date: 10 Jul 2000 13:56:43
Message: <396A0D89.699D3985@club-internet.fr>
Hi you all.

To make a smooth animation, I'd like to measure the distance between two
points ( ie : distance between <2,3,4> and <7,-8,3>)

Does anyone know the formulae to calculate it?

Thanks



Post a reply to this message

From: Oded
Subject: Re: For the math minded people
Date: 10 Jul 2000 14:05:50
Message: <396a107e@news.povray.org>
of course:
distance(<x,y,z> to <x1,y1,z1>) =
   __________________________
  /            2                  2                   2
\/ (x - x1)   +  (y  - y1)  +    (z  -  z1)




news:396A0D89.699D3985@club-internet.fr...
> Hi you all.
>
> To make a smooth animation, I'd like to measure the distance between two
> points ( ie : distance between <2,3,4> and <7,-8,3>)
>
> Does anyone know the formulae to calculate it?
>
> Thanks
>

>
>


Post a reply to this message

From: Ron Parker
Subject: Re: For the math minded people
Date: 10 Jul 2000 14:06:34
Message: <slrn8mk4vs.pm2.ron.parker@linux.parkerr.fwi.com>

>Hi you all.
>
>To make a smooth animation, I'd like to measure the distance between two
>points ( ie : distance between <2,3,4> and <7,-8,3>)
>
>Does anyone know the formulae to calculate it?

The simple way, in POV script, is vlength(A-B) where A and B are the vectors
you want the distance between.  The formula actually used is

sqrt( (A.x-B.x)*(A.x-B.x)+(A.y-B.y)*(A.y-B.y)+(A.z-B.z)*(A.z-B.z))

which is from the Pythagorean Theorem in three dimensions.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: How Camp
Subject: Re: For the math minded people
Date: 10 Jul 2000 14:07:58
Message: <396a10fe@news.povray.org>
The scalar distance between two points can be found by:

sqrt( (x2 - x1)^2 + (y2 - y1)^2 + (z2 - z1)^2 )

where <x1, y1, z1> is your first point, and <x2, y2, z2> is your second
point.

So, in your example:

sqrt( (7 - 2)^2 + (-8 - 3)^2 + (3 - 4)^2 )

= sqrt( 5^2 + (-5)^2 + (-1)^2 )

= sqrt( 25 + 25 + 1)

= sqrt(51)

= 7.14 (approximately)


- How



news:396A0D89.699D3985@club-internet.fr...
> Hi you all.
>
> To make a smooth animation, I'd like to measure the distance between two
> points ( ie : distance between <2,3,4> and <7,-8,3>)
>
> Does anyone know the formulae to calculate it?
>
> Thanks
>

>
>


Post a reply to this message

From: David Fontaine
Subject: Re: For the math minded people
Date: 10 Jul 2000 14:55:14
Message: <396A1A62.15B3629C@faricy.net>
Oded wrote:

> of course:
> distance(<x,y,z> to <x1,y1,z1>) =
>    __________________________
>   /            2                  2                   2
> \/ (x - x1)   +  (y  - y1)  +    (z  -  z1)

Gee, that looks nice in the variable-length font, but maybe you should've
aligned to the fixed-width font... :)

--
David Fontaine     <dav### [at] faricynet>     ICQ 55354965
Please visit my website: http://www.faricy.net/~davidf/


Post a reply to this message

From: Andrea Ryan
Subject: Re: For the math minded people
Date: 10 Jul 2000 16:56:26
Message: <396A3622.FD698EE@global2000.net>
Does the formula give the "hypotenuse" of a shape that looks like a doorstop or
is it a different shape?
Brendan

Ron Parker wrote:


> >Hi you all.
> >
> >To make a smooth animation, I'd like to measure the distance between two
> >points ( ie : distance between <2,3,4> and <7,-8,3>)
> >
> >Does anyone know the formulae to calculate it?
>
> The simple way, in POV script, is vlength(A-B) where A and B are the vectors
> you want the distance between.  The formula actually used is
>
> sqrt( (A.x-B.x)*(A.x-B.x)+(A.y-B.y)*(A.y-B.y)+(A.z-B.z)*(A.z-B.z))
>
> which is from the Pythagorean Theorem in three dimensions.
>
> --
> Ron Parker   http://www2.fwi.com/~parkerr/traces.html
> My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: Warp
Subject: Re: For the math minded people
Date: 10 Jul 2000 17:09:38
Message: <396a3b92@news.povray.org>
Come on, it's povray. There's the easy way:

vlength(<2,3,4>-<7-8,3>)

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Ron Parker
Subject: Re: For the math minded people
Date: 10 Jul 2000 17:12:34
Message: <slrn8mkfsm.po3.ron.parker@linux.parkerr.fwi.com>
On Mon, 10 Jul 2000 16:46:26 -0400, Andrea Ryan wrote:
>Does the formula give the "hypotenuse" of a shape that looks like a doorstop or
>is it a different shape?

It gives the length of the diagonal of the largest rectangular face on a 
solid that looks like a doorstop (assuming you mean a wedge-shaped doorstop.)
That happens to also be the straight line that connects the two points.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: Ron Parker
Subject: Re: For the math minded people
Date: 10 Jul 2000 17:14:04
Message: <slrn8mkfvh.po3.ron.parker@linux.parkerr.fwi.com>
On 10 Jul 2000 17:09:38 -0400, Warp wrote:
>  Come on, it's povray. There's the easy way:
>
>vlength(<2,3,4>-<7-8,3>)

#macro DistanceBetweenPoints( A, B )
  vlength(<0,0,0>+A-B)
#end

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: Chris Huff
Subject: Re: For the math minded people
Date: 10 Jul 2000 18:30:39
Message: <chrishuff-4F7800.17305910072000@news.povray.org>
In article <396### [at] global2000net>, Andrea Ryan 
<ary### [at] global2000net> wrote:

> Does the formula give the "hypotenuse" of a shape that looks like a 
> doorstop or is it a different shape?

It really just gives the hypotenuse of a 3D triangle...I sometimes think 
of it as the line between the front-left-bottom corner and the 
back-right-top corner of an axis-aligned box.

-- 
Christopher James Huff - Personal e-mail: chr### [at] maccom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://homepage.mac.com/chrishuff/
TAG Web page: http://tag.povray.org/


Post a reply to this message

Goto Latest 10 Messages Next 6 Messages >>>

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