Problem 2213 Common Tangents Accept: 7    Submit: 8Time Limit: 1000 mSec    Memory Limit : 32768 KB  Problem Description Two different circles can have at most four common tangents. The picture below is an illustration of two circles with four common…
Description 题目描述 Two different circles can have at most four common tangents. The picture below is an illustration of two circles with four common tangents. Now given the center and radius of two circles, your job is to find how many common tangents…
题目链接:http://acm.fzu.edu.cn/problem.php?pid=2213 题目大意:两个圆,并且知道两个圆的圆心和半径,求这两个圆共同的切线有多少条,若有无数条,输出-1,其他条如数输出 解题思路:这道题只需要判断两圆心的距离与半径的距离即可,代码里面有详细解释 AC代码 #include <cstdio> #include <algorithm> #include <iostream> #include <cstring> #incl…
其实是不太好意思往博客上放的,因为是一道巨水的题,但是我却错了一次,没有判断重合,放上还是为了警示自己,尽量不要在水题上罚时 #include<iostream> #include<cstdio> #include<algorithm> using namespace std; int main() { int t; int x1,y1,r1,x2,y2,r2; scanf("%d",&t); while(t--) { scanf("…
Problem B Common Tangents Accept: 191    Submit: 608 Time Limit: 1000 mSec    Memory Limit : 32768 KB Problem Description Two different circles can have at most four common tangents. The picture below is an illustration of two circles with four commo…
Home Web Board ProblemSet Standing Status Statistics   Problem D: 判断两个圆之间的关系 Problem D: 判断两个圆之间的关系 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 381  Solved: 325[Submit][Status][Web Board] Description 定义Point类,包括double类型的两个属性,分别表示二维空间中一个点的横纵坐标:定义其必要…
题目链接 题意 : 给你两个圆的半径和圆心,让你求两个圆相交的面积大小. 思路 : 分三种情况讨论 假设半径小的圆为c1,半径大的圆为c2. c1的半径r1,圆心坐标(x1,y1).c2的半径r2,圆心坐标(x2,y2). d为两圆圆心连线的长度. 相交面积为S d=sqrt((x1-x2)^2+(y1-y2)^2) (1)如果r1+r2<=d 那么两圆相离,相交面积S=0 (2)如果r2-r1>=d 那么半径小的圆内含半径大的圆,那么相交面积为小圆的面积S=pi*r1*r1 (3)既非(1)…
最近由于项目需要,根据两个圆函数求出相交的坐标.实现代码如下,另感谢两圆求交点算法实现Java代码,虽然他所贡献的代码中存在问题,但仍有借鉴意义. 1.两个圆相交的数学求法 在中学数学中我们知道,一个圆可以作如下描述,以x1,y1为圆心,r为半径的一个圆: 那么假设现在有两个圆C1与C2,其中C1与C2的描述式如下: 其中C1是以(x1,y1)为圆心,r1为半径的圆,C2是以(x2,y2)为圆心,r2为半径的圆.若想求两个圆的交点,那么这个交点一同时在C1与C2上,即同时满足C1与C2的方程,此…
#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include <math.h> #include <easyx.h> #include <graphics.h> typedef struct T_circle { int x; //x轴坐标 int y;//Y轴坐标 int r; //圆的半径 }yuan; void panduan(yuan test1, yuan test2) { double d;…
链接 貌似这样的叫解析几何 重点如何求得过光源到圆的切线与地板的交点x坐标,可以通过角度及距离来算,如图, 根据距离和半径可以求得角度a.b.r,自然也可以求得d1,d2. 至于方向问题,在求r得时候 可以使r = asin((p.x-c.x)/d) p为源点,c为圆心 ,d为两点距离. 若在反方向,自然r为负角 ,并不影响最后的结果. 排序后,统计区间就可以了. #include <iostream> #include<cstdio> #include<cstring>…