Problem 1330 Center of Gravity

Accept: 443    Submit: 830
Time Limit: 1000 mSec    Memory Limit : 32768 KB

 Problem Description

Given a sector of radius R, central angle P. You are to calculate the distance between the center of gravity and the center of the circle.

 Input

Given a sector of radius R, central angle P. You are to calculate the distance between the center of gravity and the center of the circle.

 Output

Given a sector of radius R, central angle P. You are to calculate the distance between the center of gravity and the center of the circle.

 Sample Input

0.01 6.28

 Sample Output

0.000003

 
  计算几何,求扇形的重心
  看的教程里有求扇形重心的公式,我就直接拿来用了:
  
  
  可以看出,这里求的重心位置是重心到圆心的距离,正好是这道题求得值。
  代码
 #include <stdio.h>
#include <math.h>
int main()
{
double r,p;
while(scanf("%lf%lf",&r,&p)!=EOF){
double z; //扇形重心
p/=;
// 求扇形重心公式一
//double b = r*sin(p); //圆心角对应的弦长
//double s = p*r; //圆心角对应的弧长
//z = 2*r*b/(3*s);
//公式二
z = *r*sin(p)/(*p);
printf("%lf\n",z);
}
return ;
}

  PS:公式一是公式二的推导后的公式。

 

Freecode : www.cnblogs.com/yym2013

fzu 1330:Center of Gravity(计算几何,求扇形重心)的更多相关文章

  1. hdu 2105:The Center of Gravity(计算几何,求三角形重心)

    The Center of Gravity Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Ot ...

  2. hdu 1115:Lifting the Stone(计算几何,求多边形重心。 过年好!)

    Lifting the Stone Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others ...

  3. HDU 2105 The Center of Gravity (数学)

    题目链接 Problem Description Everyone know the story that how Newton discovered the Universal Gravitatio ...

  4. HDU 2105 The Center of Gravity

    http://acm.hdu.edu.cn/showproblem.php?pid=2105 Problem Description Everyone know the story that how ...

  5. hdu1115 Lifting the Stone(几何,求多边形重心模板题)

    转载请注明出处:http://blog.csdn.net/u012860063 题目链接:pid=1115">http://acm.hdu.edu.cn/showproblem.php ...

  6. POJ 2225 / ZOJ 1438 / UVA 1438 Asteroids --三维凸包,求多面体重心

    题意: 两个凸多面体,可以任意摆放,最多贴着,问他们重心的最短距离. 解法: 由于给出的是凸多面体,先构出两个三维凸包,再求其重心,求重心仿照求三角形重心的方式,然后再求两个多面体的重心到每个多面体的 ...

  7. UVALive 4426 Blast the Enemy! --求多边形重心

    题意:求一个不规则简单多边形的重心. 解法:多边形的重心就是所有三角形的重心对面积的加权平均数. 关于求多边形重心的文章: 求多边形重心 用叉积搞一搞就行了. 代码: #include <ios ...

  8. 牛客网暑期ACM多校训练营(第三场) J Distance to Work 计算几何求圆与多边形相交面积模板

    链接:https://www.nowcoder.com/acm/contest/141/J来源:牛客网 Eddy has graduated from college. Currently, he i ...

  9. 计算几何--求凸包模板--Graham算法--poj 1113

    Wall Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 28157   Accepted: 9401 Description ...

随机推荐

  1. SlidingMenu(一)

    我们一般称之为侧边栏,今天下倒腾了一下,留点笔记... 源码来自:https://github.com/jfeinstein10/SlidingMenu 来张图把: 代码API注释看看这个吧 http ...

  2. JavaWeb 获取请求网络协议、IP、端口号、项目根路径

      JavaWeb 获取请求网络协议.IP.端口号.项目根路径 CreateTime--2018年6月1日16点32分 Author:Marydon 1.需求 在项目中,需要使用Java向本程序发送r ...

  3. 【apache2】apache2查看错误日志、请求日志

    1.一般存储路径在 [ /var/log/apache2/ ]下面, 2.错误日志和请求日志 必须要进行定期清理. 清理完成后,必须重启apache  [  cd /  ;  service apac ...

  4. BeanUtils的介绍使用

    BeanUtils工具 在实际的开发中我们经常需要将用户的录入的数据进行封装为对象,那么如果使用反射和内省技术就会变得吃力.因此本节主要给大家讲解一个开源的操作JavaBean的一个工具即BeanUt ...

  5. javascript 异常基本语法

    http://www.w3school.com.cn/js/js_onerror.asp try...catch 的作用是测试代码中的错误.   JavaScript - 捕获错误 当我们在网上冲浪时 ...

  6. EntityFramework Data Annotations

    详细的实体映射介绍(Data Annotation) http://msdn.microsoft.com/en-us/data/jj591583

  7. Faster RCNN原理分析 :Region Proposal Networks详解

    博主的论文笔记: https://blog.csdn.net/YZXnuaa/article/details/79221189 很详细! 另外,关于博主的博客很多拓展知识面: 120篇 深度学习23篇 ...

  8. unity, copy-paste component

    然后到要粘贴的地方,点弹出下拉菜单,如图: 得到:

  9. SCUT入门-协议生成器配置

    协议生成器需要放在IIS里才能正常使用.具体目录在:Scut\Source\Tools\ContractTools\release 关于具体细节看这篇:https://github.com/ScutG ...

  10. Atitit.分布式远程调用  rpc  rmi  CORBA的关系

    Atitit.分布式远程调用  rpc  rmi  CORBA的关系 1. 远程调用(包括rpc,rmi,rest)1 2. 分布式调用大体上就分为两类,RPC式的,REST式的1 3. RPC(远程 ...