POV-Ray : Newsgroups : povray.advanced-users : For the math minded people : Re: For the math minded people Server Time
2 Nov 2024 03:12:54 EDT (-0400)
  Re: For the math minded people  
From: Ron Parker
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

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