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
23 Apr 2024 07:37:32 EDT (-0400)
  Re: How to check if three points are in line?  
From: kurtz le pirate
Date: 6 Jun 2020 04:03:41
Message: <5edb4ddd$1@news.povray.org>
On 06/06/2020 05:12, Tor Olav Kristensen wrote:

> #declare vC = vcross(p2 - p1, p3 - p1);
> 
> 
> Now if vlength(vC) <= Nil, then the points are in line or almost in line.

Wholeheartedly agree.
If cross product of two vectors is null, the points are aligned.
Just be careful about 'null' value.




-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message

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