Advertisement
Guest User

Untitled

a guest
May 26th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1.  
  2. double norm_dist_to(const Particle &p) {
  3. double x_diff = p.x - x;
  4. double y_diff = p.y - y;
  5. double z_diff = p.z - z;
  6.  
  7. return max(MIN_DIST,
  8. sqrt(pow(x_diff, 2) + pow(y_diff, 2) + pow(z_diff, 2)));
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement