ParametrizedLine operates under the assumption that origins passed in are standardized. If developers create two lines that are mathematically identical, but are created with different origins, functions such as isApprox will fail unexpectedly. There's a chance I'm misunderstanding something, but it seems that this is a bug. There are two solutions I can think of: * As in the warning about the direction being normalized, we could warn that the origin is assumed to be a particular dim - 1 intercept, * We could calculate some standardized origin internally though this might cause lowered performance for those creating large numbers of ParametrizedLines.
Note that this is a *parametrized* line, so the origin is very important and unique. That said, we could clarify that in the class documentation and in the doc of isApprox. We could even imagine adding another "is approx" like function neglecting the parametrization, and/or add a function to transform it to a canonical form...
> Note that this is a *parametrized* line, so the origin is very important and unique. I wasn't aware of the distinction. (It's been a while since linear algebra) Does this perhaps argue for a separate class that is just "Line" or "CannonicalLine" which is not parametrized?
It took me a while to arrive at the idea that for even slightly non parallel lines, the concept of approximately "same" is nonsensical in the sense that any two non parallel lines will intersect *somewhere* and in that neighborhood they will seem approximately the same. Sorry, part of making an awesome, easy to use matrix lib is putting up us less mathematically focused people : ) Users can of course do their own direction comparison, but IMO it might be nice to encapsulate this in a "isApproxParallel" which would simply compare the directions + negative directions with some epsilon, which would be cleaner than people doing it by hand all over the place. Combined with the distance function that's already there, I think this would be a helpful addition for people doing lots of line comparison. I'll write up a patch tomorrow in case the Eigen team agrees.
-- GitLab Migration Automatic Message -- This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/301.