1855:|-相交点

来源:互联网 发布:unity3d射击游戏项目 编辑:程序博客网 时间:2024/05/17 23:18

1855:|-相交点


Description


圆1 圆心坐标(-1,0)半径为1.5,圆2圆心坐标为(2,0)半径为2,求这两个圆的交点坐标,结果保留小数点后三位


Input



Output


顺序输出两个点坐标,输出格式如下

x1 y1

x2 y2



#include<iostream>#include<iomanip>#include<stdio.h>#include<math.h>using namespace std;int main(){   double x1,x2,y1,y2,a,b;   x1=1.25/6;   x2=(1.25/6);    y1=sqrt(2.25-((1.25/6)+1)*((1.25/6)+1));   y2=-y1;   cout<<setprecision(3)<<fixed<<x1<<" "<<y1<<endl;   cout<<setprecision(3)<<fixed<<x2<<" "<<y2<<endl;}