fix lp_distance function

just for correctness, input is always in first quadrant when invoked from modifier
This commit is contained in:
a1xd 2022-04-13 17:12:21 -04:00
parent a69f398964
commit 2198512f79

View file

@ -33,5 +33,5 @@ inline double magnitude(const vec2d& v)
inline double lp_distance(const vec2d& v, double p)
{
return pow(pow(v.x, p) + pow(v.y, p), 1 / p);
return pow(pow(fabs(v.x), p) + pow(fabs(v.y), p), 1 / p);
}