当前位置: 首页 > news >正文

厦门专业建站系统制作公司深圳创业补贴2023

厦门专业建站系统制作公司,深圳创业补贴2023,中国科技大学,聋哑工作设计做网站转载 两圆相交分如下集中情况#xff1a;相离、相切、相交、包含。 设两圆圆心分别是O1和O2#xff0c;半径分别是r1和r2#xff0c;设d为两圆心距离。又因为两圆有大有小#xff0c;我们设较小的圆是O1。 相离相切的面积为零#xff0c;代码如下#xff1a; [cpp] view …转载   两圆相交分如下集中情况相离、相切、相交、包含。 设两圆圆心分别是O1和O2半径分别是r1和r2设d为两圆心距离。又因为两圆有大有小我们设较小的圆是O1。 相离相切的面积为零代码如下   [cpp] view plaincopy print? double d  sqrt((a.x-b.x)*(a.x-b.x)  (a.y-b.y)*(a.y-b.y));  if (d  r1r2)      return 0;   double d sqrt((a.x-b.x)*(a.x-b.x) (a.y-b.y)*(a.y-b.y)); if (d r1r2)return 0; 包含的面积就是小圆的面积了代码如下     [cpp] view plaincopy print? if(r2 - r1  d)      return pi*r1*r1;   if(r2 - r1 d)return pi*r1*r1; 接下来看看相交的情况。   相交面积可以这样算扇形O1AB - △O1AB 扇形O2AB - △O2AB这两个三角形组成了一个四边形可以用两倍的△O1AO2求得 所以答案就是两个扇形-两倍的△O1AO2 因为 所以 那么 同理 接下来是四边形面积 代码如下   double ang1acos((r1*r1d*d-r2*r2)/(2*r1*d)); double ang2acos((r2*r2d*d-r1*r1)/(2*r2*d)); return ang1*r1*r1 ang2*r2*r2 - r1*d*sin(ang1);     #includeiostream #includecmath using namespace std;#define pi acos(-1.0)typedef struct node {int x;int y; }point;double AREA(point a, double r1, point b, double r2) {double d sqrt((a.x-b.x)*(a.x-b.x) (a.y-b.y)*(a.y-b.y));if (d r1r2)return 0;if (r1r2){double tmp r1;r1 r2;r2 tmp;}if(r2 - r1 d)return pi*r1*r1;double ang1acos((r1*r1d*d-r2*r2)/(2*r1*d));double ang2acos((r2*r2d*d-r1*r1)/(2*r2*d));return ang1*r1*r1 ang2*r2*r2 - r1*d*sin(ang1); }int main() {point a, b;a.x2, a.y2;b.x7, b.y2;double result AREA(a, 3, b, 5);printf(%lf\n, result);return 0; }       Intersection Time Limit: 4000/4000 MS (Java/Others)    Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 3443    Accepted Submission(s): 1302 Problem Description Matt is a big fan of logo design. Recently he falls in love with logo made up by rings. The following figures are some famous examples you may know. A ring is a 2-D figure bounded by two circles sharing the common center. The radius for these circles are denoted by r and R (r R). For more details, refer to the gray part in the illustration below. Matt just designed a new logo consisting of two rings with the same size in the 2-D plane. For his interests, Matt would like to know the area of the intersection of these two rings.   Input The first line contains only one integer T (T ≤ 105), which indicates the number of test cases. For each test case, the first line contains two integers r, R (0 ≤ r R ≤ 10). Each of the following two lines contains two integers xi, yi (0 ≤ xi, yi ≤ 20) indicating the coordinates of the center of each ring.   Output For each test case, output a single line “Case #x: y”, where x is the case number (starting from 1) and y is the area of intersection rounded to 6 decimal places.   Sample Input 2 2 3 0 0 0 0 2 3 0 0 5 0   Sample Output Case #1: 15.707963 Case #2: 2.250778 #includecstdio #includecmath #includecstring #includealgorithm using namespace std; double x1,ya,x2,y2,dis,s1,s2,s3,R,r; double sov(double R,double r){if(disrR) return 0;if(disR-r) return acos(-1.0)*r*r;double x(R*R-r*rdis*dis)/2.0/dis;double y(r*r-R*Rdis*dis)/2.0/dis;double seta12*acos(x/R);double seta22*acos(y/r);double ansseta1*R*R/2.0seta2*r*r/2.0;double hsqrt(R*R-x*x);return ans-dis*h; } int main(){int tas1,T;for(scanf(%d,T);T--;){scanf(%lf%lf,r,R);scanf(%lf%lf%lf%lf,x1,ya,x2,y2);dissqrt((x1-x2)*(x1-x2)(ya-y2)*(ya-y2));s1sov(R,R),s2sov(R,r),s3sov(r,r);printf(Case #%d: %.6f\n,tas,s1-2*s2s3);} }    转载于:https://www.cnblogs.com/mfys/p/7622133.html
http://wiki.neutronadmin.com/news/109577/

相关文章:

  • 萤火虫网站建设优化纯html5网站源码
  • 行业门户型网站制作wordpress 链接新窗口打开
  • 网站简繁转换做网站一般注意些什么
  • 网站建设推广是什么意思计算机培训机构排名最新
  • 织梦iis7搭建网站二手交易网站建设目标
  • 外贸做包装袋哪个网站好可以做公众号的网站吗
  • 免费可用的网站源码开发公司如何加强财务管理
  • 部门网站建设多少钱html网页代码完整代码四个跳
  • 兰州微信信息平台网站建设成都住房和城乡建设厅网站
  • 做们作业网站做网站数据需要的软件
  • 号店网站建设公司简易签名设计一笔签
  • 抄袭网站后台会侵权吗WordPress用Aplayer
  • 济宁网站开发平台网站排行榜前十名
  • 企业网站app制作价格黑科技网站
  • 广州专业的网站开发公司做淘客网站要什么样服务器
  • 湖北网站建设找哪家昆明网
  • 俄文手机网站制作网站开发公司oa
  • 300元做网站网站后台图片上传失败
  • 镇江网站制作企业网站网易163企业邮箱格式
  • 手机网站排行榜专门查公司的软件
  • 现在做什么网站好企业网站建设实训指导书
  • wordpress级简主题怎样优化网站关键词
  • 网站建设规划书的空间罗湖网站建设多少钱
  • 网站设计与开发公司最好的国际贸易网站
  • 修水县城乡建设局网站网络服务合同范本
  • 网站里的友情链接阿里巴巴国际站关键词推广
  • 站长之家域名查询鹿少女云南电信网站备案
  • vs2010做网站子域名大全
  • 网站统计模块周村网站建设
  • 网站建设上线合肥网站建设技术托管