On Thursday 16 March 2006 07:28, eddkay opined (in
<11**********************@z34g2000cwc.googlegroups .com>):
hi i have an assignment about the topic above. thus finding out all
the possible lines aviable among a set of points given (x,y).
1. how do i write all the line without repeat them (each line is
written once)
Your question really belongs to comp.programming, but...
Think about what uniquely defines a line: f(x) = A*x + B. So, you start
looking for lines defined by all your points, storing As and Bs as you
go along, but only if you didn't find the same pair earlier. Once
finished, you have a neat set of line coefficients.
Caveat: As and Bs are real numbers (in maths sense), but you're going to
be dealing with floating point numbers. The former are not always
exactly representable as the latter. You may need some "fuzziness"
factor (or a better idea than mine).
--
BR, Vladimir
I want to buy a husband who, every week when I sit down to watch "St.
Elsewhere", won't scream, "Forget it, Blanche... It's time for Hee-Haw!"