/* * Copyright (C) 2021 Christopher J. Howard * * This file is part of Antkeeper source code. * * Antkeeper source code is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Antkeeper source code is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Antkeeper source code. If not, see . */ #ifndef ANTKEEPER_MATH_QUATERNION_OPERATORS_HPP #define ANTKEEPER_MATH_QUATERNION_OPERATORS_HPP #include "math/quaternion-type.hpp" #include "math/quaternion-functions.hpp" /// @copydoc math::add(const math::quaternion&, const math::quaternion&) template math::quaternion operator+(const math::quaternion& x, const math::quaternion& y); /// @copydoc math::div(const math::quaternion&, T) template math::quaternion operator/(const math::quaternion& q, T s); /// @copydoc math::mul(const math::quaternion&, const math::quaternion&) template math::quaternion operator*(const math::quaternion& x, const math::quaternion& y); /// @copydoc math::mul(const math::quaternion&, T) template math::quaternion operator*(const math::quaternion& q, T s); /// @copydoc math::mul(const math::quaternion&, const math::vector&) template math::vector operator*(const math::quaternion& q, const math::vector& v); /// @copydoc math::sub(const math::quaternion&, const math::quaternion&) template math::quaternion operator-(const math::quaternion& x, const math::quaternion& y); /// @copydoc math::negate(const math::quaternion&) template math::quaternion operator-(const math::quaternion& x); template inline math::quaternion operator+(const math::quaternion& x, const math::quaternion& y) { return add(x, y); } template inline math::quaternion operator/(const math::quaternion& q, T s) { return div(q, s); } template inline math::quaternion operator*(const math::quaternion& x, const math::quaternion& y) { return mul(x, y); } template inline math::quaternion operator*(const math::quaternion& q, T s) { return mul(q, s); } template inline math::vector operator*(const math::quaternion& q, const math::vector& v) { return mul(q, v); } template inline math::quaternion operator-(const math::quaternion& x, const math::quaternion& y) { return sub(x, y); } template inline math::quaternion operator-(const math::quaternion& x) { return negate(x); } #endif // ANTKEEPER_MATH_QUATERNION_OPERATORS_HPP