Advertisement
Korotkodul

ЗОШ геома сдаем

Jan 10th, 2022
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <vector>
  4. #include <queue>
  5. #include <algorithm>
  6. #include <string>
  7. #include <stack>
  8. #include <set>
  9. #include <map>
  10. #include <math.h>
  11. #define pii pair <int,int>
  12. using namespace std;
  13. using ll = long long;
  14. using ld = long double;
  15. using db = double;
  16. void cv(vector <int> &v){
  17. for (auto x: v) cout<<x<<' ';
  18. cout<<"\n";
  19. }
  20.  
  21. void cvl(vector <ll> &v){
  22. for (auto x: v) cout<<x<<' ';
  23. cout<<"\n";
  24. }
  25.  
  26.  
  27. void cvv(vector <vector <int> > &v){
  28. for (auto x: v) cv(x);
  29. cout<<"\n";
  30. }
  31.  
  32. struct ipn{
  33. int x,y;
  34. };
  35.  
  36. struct rpn{
  37. db x,y;
  38. };
  39.  
  40. rpn div(rpn A, rpn B, db p, db q){
  41. rpn res;
  42. res.x = (q * A.x + p * B.x) / (p + q);
  43. res.y = (q * A.y + p * B.y) / (p+q);
  44. return res;
  45. }
  46.  
  47. db dot(rpn a, rpn b){
  48. return a.x * b.x + a.y * b.y;
  49. }
  50.  
  51. db lgth(rpn a){
  52. return sqrt(a.x * a.x + a.y * a.y);
  53. }
  54.  
  55. db angl(rpn a, rpn b){
  56. db an = acos(dot(a, b) / ( lgth(a) * lgth(b)) );
  57. return an;
  58. }
  59.  
  60. rpn add(rpn a, rpn b){
  61.  
  62. }
  63.  
  64.  
  65. int main()
  66. {
  67. ios::sync_with_stdio(0);
  68. cin.tie(0);
  69. cout.tie(0);
  70. cout.precision(20);
  71. rpn a,b,c,d,e;
  72. cin>>a.x>>a.y>>b.x>>b.y>>c.x>>c.y;
  73. d = div(a, b, lgth())
  74. }
  75.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement