Commit 8c3f1602 authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

no hypot

parent 56eca17f
......@@ -971,8 +971,8 @@ static int contact_solve(ParticleProblem *p, Contact *c, double dt, double tol)
body1->velocity[0]-body1->omega*c->r1[1]-body0->velocity[0]+body0->omega*c->r0[1],
body1->velocity[1]+body1->omega*c->r1[0]-body0->velocity[1]-body0->omega*c->r0[0]
};
double dv = hypot(new_dv[0]-old_dv[0], new_dv[1]-old_dv[1]);
return dv*dt < tol;
double dv[2] = {new_dv[0]-old_dv[0], new_dv[1]-old_dv[1]};
return (dv[0]*dv[0]+dv[1]*dv[1])*dt*dt < tol*tol;
}
void swap(int *a, int *b) {
......
......@@ -4,7 +4,7 @@ import os
import numpy as np
odir = "output"
friction=False
friction=True
os.makedirs(odir,exist_ok=True)
pieces = np.genfromtxt("pieces.txt")
pieces_omega = pieces[:,0]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment