(28S) three points are collinear ? - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: General Software Library (/forum-13.html) +--- Thread: (28S) three points are collinear ? (/thread-86.html) |
(28S) three points are collinear ? - Damien - 12-14-2013 07:20 PM FIRST METHOD: Code: « C→R 1 A(a,a'), B(b,B'), C(c,c') are lined up if the determinant = 0 |a a' 1| |b b' 1| = 0 |c c' 1| SECOND METHOD: (added 26/12/2013) A(a,a'), B(b,B'), C(c,c') are lined up if the angle (AB,AC) = 0 modulo π (in radians) Lets find the angle (AB,AC) first Code:
then Code:
Examples: 3: (2,2) 2: (4,1) 1: (5,3) ALIG 1: 0 (false) 3: (2,-3) 2: (4,1) 1: (5,3) ALIG 1: 1 (true) |