POV-Ray : Newsgroups : povray.general : How to check if three points are in line? : Re: How to check if three points are in line? Server Time
20 Apr 2024 04:38:18 EDT (-0400)
  Re: How to check if three points are in line?  
From: Kima
Date: 5 Jun 2020 16:45:01
Message: <web.5edaaec1e3705a85ecc0fada0@news.povray.org>
"Kima" <nomail@nomail> wrote:
> I try to create a tube by connecting cylinders over a spline. To avoid
> unnecessary elements, I want to check if three points in line to avoid creation
> of two cylinders when one is sufficient.
>
> To do this, I need to calculate the normalized vector of P2-P1 and compare it
> with that of P3-P3 using the functions given at
> https://www.povray.org/documentation/view/3.6.1/459/
>
> What is the most efficient way, as it is a continuous calculation, which may
> enable me to increase the resolution (number of points).

I forgot to add that I do this VAngle(V1, V2). My question was mostly about the
general idea. If it is feasible or I've missed an emerging issue since I have
not seen such an approach in the tutorials.


Post a reply to this message

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