merge curvature stuff into this
This commit is contained in:
10
src/util.h
10
src/util.h
@ -65,4 +65,12 @@ qreal triangle_area(Point p1, Point p2, Point p3) {
|
||||
qreal cotan(const qreal x);
|
||||
|
||||
|
||||
#endif
|
||||
template <typename T>
|
||||
constexpr const T& clamp(const T& v, const T& lo, const T& hi) {
|
||||
if (v < lo) return lo;
|
||||
if (v > hi) return hi;
|
||||
return v;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user