uva 12300 - Smallest Regular Polygon
来源:互联网 发布:淘宝外包公司有哪些 编辑:程序博客网 时间:2024/06/10 09:22
题意:给定两个点A和B,求包含这两个点的面积最小的正 n(已知)边形。
#include<iostream>#include<iomanip>#include<cmath>#define pi 2.0*asin(1.0)#define sqr(a) ((a)*(a))using namespace std;int main(){ int n; double x1,x2,y1,y2,d,thy,s; while(cin>>x1>>y1>>x2>>y2>>n && x1+x2+y1+y2+n) { d=sqrt(sqr(x1-x2)+sqr(y1-y2)); thy=pi-2*pi/n; if(n%2) s=n*sqr(d*cos((thy+pi)/4))*tan(thy/2); else s=n*sqr(d/2)*sin(thy)/2; cout<<fixed<<setprecision(6)<<s<<endl; } return 0;}
- uva 12300 - Smallest Regular Polygon
- Smallest Regular Polygon - UVa 12300 几何
- UVA 12300 - Smallest Regular Polygon(计算几何)
- uva 12300 - Smallest Regular Polygon(几何)
- 注意精度问题 UVA 12300 Smallest Regular Polygon
- UVa 12300 Smallest Regular Polygon 正多边形内的计算
- uva 12300 Smallest Regular Polygon(计算几何)
- UVA12300-Smallest Regular Polygon
- UVA 12300 || Smallest Regular Polygon(给定两点,求穿过两点的最小正多边形
- Regular Polygon - UVa 10824 几何+二分
- Regular Polygon - UVa 10824 几何暴力
- Regular polygon
- Regular polygon
- Regular polygon
- Regular polygon
- Regular polygon
- Regular polygon
- Regular polygon
- typedef int(init_fnc_t) (void) 和 typedef int(*init_fnc_t) (void);
- python多线程模块使用小问题求解
- poj 1860 Currency Exchange :bellman-ford
- java的中文转拼音组件---pinyin4j
- windows下cocos2d-x android打包
- uva 12300 - Smallest Regular Polygon
- itext 5.3.0实现对pdf文件添加(文字和图片)水印
- linux 内核启动过程以及挂载android 根文件系统的过程
- web导出exl
- tomcat容器 SSH项目开发 上传图片图片名为中文时不能显示图片问题解决
- C++ 字节对齐
- 逻辑运算符(logical operator)
- android View各属性详解
- Oracle SQL tuning 数据库优化步骤分享(图文教程)