[Insight-developers] itkPoint itkVector additional methods

Paul Hughett hughett@mercur.uphs.upenn.edu
Mon, 23 Jul 2001 09:42:21 -0400


James Miller has written:

> I would also add a more general method:

> Point Point::LinearCombination(Point [], float weights[], unsigned int num) 

> return a Point which is the linear combination or weighted
> average of a set of points. I suppose this last one could be
> implemented using PointContainers and iterators. I am tempted to call
> this method weighted average but that would imply that the weights sum
> to one. I don't want to restrict the call to that case.

In fact, the weight *must* sum to one for a linear combination of points
to yield a point, so WeightedAverage would be a good name.  If the weights
sum to zero, the result is a Vector, and if the weights sum to anything
else, the result is neigther a Point nor a Vector.

Paul Hughett