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. Native App、Web App 还是Hybrid App

    Native App.Web App 还是Hybrid App? 技术 标点符 1年前 (2014-05-09) 3036℃ 0评论 一.什么是Native App? Native App即原生应用, ...

  2. DP SRM 661 Div2 Hard: ColorfulLineGraphsDiv2

    Problem Statement Bob is going to create a graph with N nodes. The graph will be constructed in two ...

  3. windows下安装redis及其客户端

    首先下载redis安装包:https://github.com/MSOpenTech/redis/releases 解压安装包到相应文件夹,任何盘符都行. 文件介绍:redis-server.exe: ...

  4. dll中使用exe中的变量

    注意:输出目录为:Result共享目录 1.exe项目: // EXE.cpp : 定义控制台应用程序的入口点.// #include "stdafx.h" extern" ...

  5. numpy 文件存取 npy、npz

    转处:http://blog.csdn.net/pipisorry/article/details/39088003 NumPy提供了多种文件操作函数方便我们存取数组内容. 文件存取的格式:二进制和文 ...

  6. C#删除xml指定节点

  7. 分布式ID生成方案

    系统唯一ID是设计一个系统的时候常常会遇到的问题,也常常为这个问题而纠结. 生成ID的方法有很多,适应不同的场景.需求以及性能要求.所以有些比较复杂的系统会有多个ID生成的策略. 0. 分布式ID要求 ...

  8. 从constructor中抛出exception后,constructor会返回null吗?

    刚才琢磨这个问题主要是在想,如果constructor抛出了exception,那么返回的object是什么一个情况呢?如果我这个object中有一些关键的资源没有初始化,比如说Database co ...

  9. Bootstrap学习笔记(4)--导航栏

    相关类: nav, nav-pills, nav-tags, nav-stacked ul里使用,导航格胶囊,方片外观,堆叠外观 navbar, navbar-header, navbar-brand ...

  10. select下拉选框的默认值,包括每次进入页面的默认值

    下拉选: <select onchange="selectTotal(this.value)" style="width: 50px;">      ...