Add 2D angle -> direction function
This commit is contained in:
parent
78eec7085d
commit
e02efd2f7b
1 changed files with 6 additions and 0 deletions
|
|
@ -302,6 +302,12 @@ namespace psemek::geom
|
||||||
return ort(v0, v1);
|
return ort(v0, v1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
vector<T, 2> direction(T angle)
|
||||||
|
{
|
||||||
|
return {std::cos(angle), std::sin(angle)};
|
||||||
|
}
|
||||||
|
|
||||||
template <typename T, std::size_t N>
|
template <typename T, std::size_t N>
|
||||||
vector<T, N> pointwise_mult(vector<T, N> const & v0, vector<T, N> const & v1)
|
vector<T, N> pointwise_mult(vector<T, N> const & v0, vector<T, N> const & v1)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue