things
This commit is contained in:
parent
748d52c9c9
commit
112a8f568b
19 changed files with 222 additions and 14 deletions
|
|
@ -5,12 +5,35 @@
|
|||
|
||||
namespace fishbone {
|
||||
float cot(float x);
|
||||
};
|
||||
template <typename T>
|
||||
std::vector<T> quadToTriangle(std::vector<T> v);
|
||||
}; // namespace fishbone
|
||||
|
||||
/* no includes */
|
||||
|
||||
namespace fishbone {
|
||||
float cot(float x);
|
||||
template <typename T>
|
||||
std::vector<T> quadToTriangle(std::vector<T> v) {
|
||||
std::vector<T> r;
|
||||
|
||||
/**
|
||||
* 1-4
|
||||
* |\|
|
||||
* 2-3
|
||||
*/
|
||||
for(int i = 0; i < v.size(); i += 4) {
|
||||
r.push_back(v[i + 0]);
|
||||
r.push_back(v[i + 1]);
|
||||
r.push_back(v[i + 2]);
|
||||
|
||||
r.push_back(v[i + 2]);
|
||||
r.push_back(v[i + 3]);
|
||||
r.push_back(v[i + 0]);
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
static double pi = 3.14159265358979323846;
|
||||
}; // namespace fishbone
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue