Skip to content

Commit

Permalink
Added deg2rad and rad2deg for arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
aslze committed May 26, 2019
1 parent 1901a63 commit 8cf1a24
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions include/asl/Array.h
Original file line number Diff line number Diff line change
Expand Up @@ -711,5 +711,23 @@ Array<T> array(const T& a0, const T& a1, const T& a2, const T& a3, const T& a4,
return _a;
}

template<class T>
static asl::Array<T> deg2rad(const asl::Array<T>& a)
{
asl::Array<T> b(a.length());
for (int i = 0; i < a.length(); i++)
b[i] = asl::deg2rad(a[i]);
return b;
}

template<class T>
static asl::Array<T> rad2deg(const asl::Array<T>& a)
{
asl::Array<T> b(a.length());
for (int i = 0; i < a.length(); i++)
b[i] = asl::rad2deg(a[i]);
return b;
}

}
#endif

0 comments on commit 8cf1a24

Please sign in to comment.