<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Apr 25, 2015 at 10:49 AM, Jerzy Karczmarczuk <span dir="ltr"><<a href="mailto:jerzy.karczmarczuk@unicaen.fr" target="_blank">jerzy.karczmarczuk@unicaen.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Many people help Mike Meyer:<br></div></blockquote><div><br></div><div>And I do appreciate it. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">
<blockquote type="cite">
<div class="gmail_extra">My real problem is that I've got a list
of points in R3 and want to decide if they determine a plane,
meaning they are coplanar but not colinear. Similarly, given a
list of points in R2, I want to verify that they aren't
colinear. Both of these can be done by converting the list of
points to a matrix and finding the rank of the matrix, but I
only use the rank function in the definitions of colinear and
coplanar.</div>
<div class="gmail_extra"><br>
</div>
<div class="gmail_extra">Maybe there's an easier way to tackle the
underlying problems. Anyone got a suggestion for such?</div>
</blockquote>
<br>
I didn't follow this discussion, so I might have missed some
essential issues, I apologize then. But if THIS is the problem...<br>
<br>
All these powerful universal libraries, with several hundreds of
lines of code are important and useful, but if the problem is to
find whether a list of pairs (x,y) is collinear or not, I presume
that such program as below could do. I am ashamed showing something
like that...<br>
<br>
<b><font face="Courier New, Courier, monospace">colin ((x,y):l) =
all (\(c,d)->abs(px*d-py*c)<eps) q where <br>
((px,py):q) = [(ax-x,ay-y) | (ax,ay) <- l]<br>
</font></b><br>
[The iterated subtraction puts the first vector at the origin. eps
is the precision; better avoid ==0]<br></div></blockquote><div><br></div><div>That's not far from what I wound up with, except I generalized it to work for both 2d and 3d vectors. And yeah, I clearly got off on the wrong foot when I turned up "test the rank of the matrix" for finding collinearity and coplanarity.</div><div><br></div><div>This pretty much solves my problem. Thanks to all who helped.</div></div></div></div>