This commit is contained in:
Nishi 2026-06-06 22:30:58 +09:00
commit 112a8f568b
19 changed files with 222 additions and 14 deletions

View file

@ -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