daily pastebin goal
32%
SHARE
TWEET

Untitled

a guest Dec 16th, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. typedef struct line
  2. {
  3.     coord m;//координаты первой точки прямой
  4.     coord n;//координаты второй точки прямой
  5.     coord v;//координаты направляющего вектора
  6.  
  7. } Line;
  8.    
  9. int isBelong(Line l, coord p)
  10. {
  11.     coord t;
  12.     t.x = (l.v.x / (p.x - l.m.x));
  13.     t.y = (l.v.y / (p.y - l.m.y));
  14.     t.z = (l.v.z / (p.z - l.m.z));
  15.     return (t.x == t.y) && (t.y == t.z) ? 1 : 0;
  16. }
  17.    
  18. pl = v * Dot(w, v) / Dot(v, v)
  19.    
  20. pr = p - pl
  21.  len =  |pr|
  22.    
  23. Dot(pr, pr) < eps^2
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top