POV-Ray : Newsgroups : povray.general : How to check if three points are in line? : How to check if three points are in line? Server Time
16 Apr 2024 06:00:16 EDT (-0400)
  How to check if three points are in line?  
From: Kima
Date: 5 Jun 2020 14:55:01
Message: <web.5eda940f9cbbc66decc0fada0@news.povray.org>
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).


Post a reply to this message

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