POV-Ray : Newsgroups : povray.general : Point along a line. : Re: Point along a line. Server Time
4 Aug 2024 04:15:58 EDT (-0400)
  Re: Point along a line.  
From: Tim Nikias v2 0
Date: 18 Jul 2003 19:25:03
Message: <3f1881cf$1@news.povray.org>
That's either
vnormalize(B-A)*D+A
or
-vnormalize(B-A)*D+A
depending on which direction you're thinking of. The first
will either move towards or pass B when D is either smaller
or larger than the distance from A to B,
the second will move away from A and B on the line.

Now that's POV-Code, if you want the actual formula
to do it by hand, you can easily look up vnormalize in
the docs or search the web for normalizing vectors (which
is actually just dividing a vector by its length, which
can be calculated by taking the square-root of the addition
of each component (x, y, and z) squared...
That'd be:
square_root( x*x + y*y + z*z)

That isn't POV-Code, its Pseudo-Code to aid in understanding
the complicated sentence above. :-)

-- 
Tim Nikias v2.0
Homepage: http://www.digitaltwilight.de/no_lights


> If i have 2 points A <x1,y1,z1> and B <x2,y2,z2>, how do i find
coordinates
> of point C <x3,y3,z3> which lies on the line AB, distance D from point A?
>
> Thank you,
>
> Boris.
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.501 / Virus Database: 299 - Release Date: 14.07.2003


Post a reply to this message

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