Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00025
00042
00043 #ifndef THOR_VECTORALGEBRA2D_HPP
00044 #define THOR_VECTORALGEBRA2D_HPP
00045
00046 #include <Thor/Math/Trigonometry.hpp>
00047
00048 #include <SFML/System/Vector2.hpp>
00049
00050 #include <cassert>
00051
00052
00053 namespace thor
00054 {
00055
00058
00061 template <typename T>
00062 T length(const sf::Vector2<T>& vector);
00063
00066 template <typename T>
00067 T squaredLength(const sf::Vector2<T>& vector);
00068
00072 template <typename T>
00073 void setLength(sf::Vector2<T>& vector, T newLength);
00074
00077 template <typename T>
00078 sf::Vector2<T> unitVector(const sf::Vector2<T>& vector);
00079
00084 template <typename T>
00085 T polarAngle(const sf::Vector2<T>& vector);
00086
00089 template <typename T>
00090 void setPolarAngle(sf::Vector2<T>& vector, T newAngle);
00091
00094 template <typename T>
00095 void rotate(sf::Vector2<T>& vector, T angle);
00096
00099 template <typename T>
00100 sf::Vector2<T> rotatedVector(const sf::Vector2<T>& vector, T angle);
00101
00105 template <typename T>
00106 sf::Vector2<T> perpendicularVector(const sf::Vector2<T>& vector);
00107
00108
00109
00110
00115 template <typename T>
00116 T signedAngle(const sf::Vector2<T>& lhs, const sf::Vector2<T>& rhs);
00117
00120 template <typename T>
00121 T dotProduct(const sf::Vector2<T>& lhs, const sf::Vector2<T>& rhs);
00122
00126 template <typename T>
00127 T crossProduct(const sf::Vector2<T>& lhs, const sf::Vector2<T>& rhs);
00128
00131 template <typename T>
00132 sf::Vector2<T> cwiseProduct(const sf::Vector2<T>& lhs, const sf::Vector2<T>& rhs);
00133
00137 template <typename T>
00138 sf::Vector2<T> cwiseQuotient(const sf::Vector2<T>& lhs, const sf::Vector2<T>& rhs);
00139
00143 template <typename T>
00144 sf::Vector2<T> projectedVector(const sf::Vector2<T>& vector, const sf::Vector2<T>& axis);
00145
00147
00148 }
00149
00150 #include <Thor/Vectors/Detail/VectorAlgebra2D.inl>
00151 #endif // THOR_VECTORALGEBRA2D_HPP