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. Sublime Text 包管理工具及扩展大全

    Sublime Text 是程序员们公认的编码神奇,拥有漂亮的用户界面和强大的功能,例如代码缩略图,多重选择,快捷命令等.还可自定义键绑定,菜单和工具栏.Sublime Text 的主要功能包括:拼写 ...

  2. MIME protocol 说明

    按照 <张孝祥Java邮件开发详解> 自己create了 emali, 其中jpg 和wav文件格式过大,删除了写内容 From redhat@diego.com Mon Nov 17 0 ...

  3. Android开发笔记(一百三十四)协调布局CoordinatorLayout

    协调布局CoordinatorLayout Android自5.0之后对UI做了较大的提升.一个重大的改进是推出了MaterialDesign库,而该库的基础即为协调布局CoordinatorLayo ...

  4. ubuntu16.4安装后做的事情

    1.安装搜狗拼音输入法 http://pinyin.sogou.com/linux/help.php 2.安装谷歌浏览器 http://jingyan.baidu.com/article/335530 ...

  5. Python OS 文件

    Python OS 文件: 1 os.access(path, mode) 检验权限模式 2 os.chdir(path) 改变当前工作目录 3 os.chflags(path, flags) 设置路 ...

  6. Asp.Net Core + SignalR 实现实时通信

    一.搭建项目 1.创建一个ASP.NET Core MVC 项目 2.nuget 下载和安装 MicroSoft.AspNetCore.SignalR vs提示版本冲突 这时我们选择低版本即可 二.S ...

  7. 实现WinForm窗体的美化(借助第三方控件)

    在winform项目中,其实皮肤就是一个第三方的控件,名字是IrisSkin4.dll只要添加到你的工具箱里就可以和其它控件一样使用了 一.添加控件IrisSkin4.dll.方法: 先把IrisSk ...

  8. MySQL Subquery

    Summary: in this tutorial, we will show you how to use the MySQL subquery to write complex queries a ...

  9. xdebug安装教程

    自动分析应该下载的文件: http://xdebug.org/wizard.php

  10. 给ECharts添加右键点击事件,实现右键功能菜单

    由于项目的需要,使用ECharts 的力导向图来实现 整个EDW数据架构的血缘分析,由于ECharts并没有给组件定义有右键的事件,同时ECharts是开源的项目,所以研究了下源码,将ECharts2 ...