Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. Deadinsidick:
  2. double h = 2 * area(r1,r2, O1O2) / O1O2;
  3. double OE = sqrt(r1 * r1 - h * h);
  4. //cout « O1O2 « " " « h « " " « OE « "\n";
  5. point E = O1 + (O2-O1) * (OE / O1O2);
  6. point vec = rot90(O2-O1);
  7. point M1 = E + ((h / O1O2) * vec);
  8. point M2 = E - ((h / O1O2) * vec);
  9.  
  10. p0.x=a.x+(b.x-a.x)*m/l;
  11. p0.y=a.y+(b.y-a.y)*m/l;
  12. point p1,p2;
  13. p1.x=p0.x+(b.y-a.y)/l*h;
  14. p1.y=p0.y-(b.x-a.x)/l*h;
  15. p2.x=p0.x-(b.y-a.y)/l*h;
  16. p2.y=p0.y+(b.x-a.x)/l*h;
  17.  
  18. double m=(r1*r1-r2*r2+l*l)/2/l; // m-O1H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement