Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <vector>
- #include <queue>
- #include <algorithm>
- #include <string>
- #include <stack>
- #include <set>
- #include <map>
- #include <math.h>
- #define pii pair <int,int>
- using namespace std;
- using ll = long long;
- using ld = long double;
- using db = double;
- void cv(vector <int> &v){
- for (auto x: v) cout<<x<<' ';
- cout<<"\n";
- }
- void cvl(vector <ll> &v){
- for (auto x: v) cout<<x<<' ';
- cout<<"\n";
- }
- void cvv(vector <vector <int> > &v){
- for (auto x: v) cv(x);
- cout<<"\n";
- }
- struct ipn{
- int x,y;
- };
- struct rpn{
- db x,y;
- };
- rpn div(rpn A, rpn B, db p, db q){
- rpn res;
- res.x = (q * A.x + p * B.x) / (p + q);
- res.y = (q * A.y + p * B.y) / (p+q);
- return res;
- }
- db dot(rpn a, rpn b){
- return a.x * b.x + a.y * b.y;
- }
- db lgth(rpn a){
- return sqrt(a.x * a.x + a.y * a.y);
- }
- db angl(rpn a, rpn b){
- db an = acos(dot(a, b) / ( lgth(a) * lgth(b)) );
- return an;
- }
- rpn add(rpn a, rpn b){
- }
- int main()
- {
- ios::sync_with_stdio(0);
- cin.tie(0);
- cout.tie(0);
- cout.precision(20);
- rpn a,b,c,d,e;
- cin>>a.x>>a.y>>b.x>>b.y>>c.x>>c.y;
- d = div(a, b, lgth())
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement