Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float singular_weight(Vec3 a, Vec3 b, float radius, int w)
- {
- float r = (a-b).length();
- if (r < radius)
- return pow(r / radius, -w);
- else
- return 0.f;
- }
- float gaussian_weight(Vec3 a, Vec3 b, float radius)
- {
- float r = (a-b).length();
- if (r < radius)
- return exp(- r * r / (radius * radius));
- else
- return 0.f;
- }
- float wendland_weight(Vec3 a, Vec3 b, float radius)
- {
- float r = (a-b).length();
- if (r < radius)
- return pow(1 - r / radius, 4) * (1 + 4 * r / radius);
- else
- return 0.f;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement