point: point subtraction should give a vector

This commit is contained in:
Danny Robson 2015-01-19 19:14:53 +11:00
parent 319a8ce616
commit f64e232201
2 changed files with 3 additions and 3 deletions

View File

@ -111,9 +111,9 @@ util::point<S,T>::operator+= (const util::vector<S,T> &rhs) {
//-----------------------------------------------------------------------------
template <size_t S, typename T>
util::point<S,T>
util::vector<S,T>
util::point<S,T>::operator- (const point<S,T> &rhs) const {
util::point<S,T> out;
util::vector<S,T> out;
for (size_t i = 0; i < S; ++i)
out.data[i] = this->data[i] - rhs.data[i];

View File

@ -46,7 +46,7 @@ namespace util {
point<S,T> operator* (T) const;
point<S,T> operator/ (T) const;
point<S,T> operator- (const point<S,T>&) const;
vector<S,T> operator- (const point<S,T>&) const;
point<S,T> operator- (const vector<S,T>&) const;
point<S,T>& operator-= (const vector<S,T>&);