quaternion: add a subtraction operator
This commit is contained in:
parent
0dc4929c5e
commit
d45433e97f
@ -198,6 +198,20 @@ quaternion<T> cruft::operator+ (quaternion<T> a, quaternion<T> b)
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T>
|
||||
quaternion<T>
|
||||
cruft::operator- (quaternion<T> a, quaternion<T> b)
|
||||
{
|
||||
return {
|
||||
.w = a.w - b.w,
|
||||
.x = a.x - b.x,
|
||||
.y = a.y - b.y,
|
||||
.z = a.z - b.z
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
template <typename T>
|
||||
|
@ -177,6 +177,12 @@ namespace cruft {
|
||||
operator+ (quaternion<T>, quaternion<T>);
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
template <typename T>
|
||||
quaternion<T>
|
||||
operator- (quaternion<T>, quaternion<T>);
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
template <typename T>
|
||||
quaternion<T>
|
||||
|
Loading…
Reference in New Issue
Block a user