Re: [eigen] What about HyperPlane ? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
Hi,
Looking at the HyperPlane class I have a few proposals:
- rename it to Hyperplane (it's just one word).
- remove the default Dim=3 value
- Line could become a subclass of Hyperplane adding specific methods like
intersection() method and a constructor from 2 points.
- add a small class parametrizedLine with two-way conversions with Line;
rename rayInterstection() as an overloaded intersection() taking a
parametrizedLine.
- rename distanceTo() ---> distance()
- rename project() as projection()
- replace set... methods by methods returning non-const references
OK? If I do it I can at the same time make the Regression changes and port
Avogadro.
Cheers,
Benoit
On Thursday 28 August 2008 17:42:02 Gael Guennebaud wrote:
> On Thu, Aug 28, 2008 at 4:17 PM, Benoît Jacob <jacob@xxxxxxxxxxxxxxx> wrote:
> > Why not; There is a question: do you think the hyperplane equation should
> > have normalized normal vector?
>
> definitely yes ! my class currently enforces unit normal.
>
> > For most use cases, this is very useful. Like computing the distance from
> > your hyperplane to points. It is much faster if the normal vector can be
> > assumed to be normalized. For that reason a hyperplane class is much more
> > useful with normalized normal vector.
>
> exactly
>
> > This will probably require to normalize in fitHyperplane() but that's no
> > big deal, the cost is not much compared to the eigensolver used.
>
> fitHyperplane() already returns a normalized normal because it is and
> eigen vector. (hm... this remark might be quite confusing ! for the
> lost reader: don't think Eigen's vectors cannot be non-unit, only
> eigen ones are normalized ;) )
>
> > Notify me before changing the fitHyperplane() API because this affects
> > Avogadro :) We need to coordinate.
>
> yes I know that, so I'll mark the old one with a deprecated gcc
> warning for a few weeks....
>
> gael.