KIDx's Triangle

Time Limit: 2000/1000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others)

Problem Description

One day, KIDx solved a math problem for middle students in seconds! And than he created this problem.

Now, give you the degree of a, b, c, d, please calculate the degree of ∠AED.

Input

There are multiple test cases.

Each case contains one line 4 integers formatted as: "a b c d"

0 ≤ a, b, c, d < 90°.

0 < a+b < 90°, 0 < c+d < 90°.

Output

For each test case, output the answer in one line, rounded to 2 decimal places.

Sample Input

10 70 60 20
10 70 70 0

Sample Output

20.00
140.00
 #include<stdio.h>
#include<math.h>
#define pi 3.141592653589793
double a , b , c , d ;
double BE , BD , DE , bata , AD , AE ; inline double f (double k)
{
return 1.0 * k * pi / ;
} int main ()
{
freopen ("a.txt" , "r" , stdin ) ;
while (~ scanf ("%lf%lf%lf%lf" , &a , &b , &c , &d)) {
if (a == ) {
printf ("0.00\n") ;
continue ;
}
AD = sin (f(c)) / sin (f(a + b + c)) ;
BD = sin (f(c + d)) / sin (f(a + b + c + d)) - sin (f(c)) / sin (f(a + b + c)) ;
BE = sin (f(a + b)) / sin (f(a + b + c + d)) - sin (f(b)) / sin (f(b + c + d)) ; DE = sqrt (1.0 * (BE * BE + BD * BD + * BE * BD * cos (f(a + b + c + d)))) ;
AE = sin (f(c + d)) / sin (f(b + c + d)) ;
bata = acos (1.0 * (DE * DE + AE * AE - AD * AD) / (2.0 * DE * AE)) * / pi;
// printf ("DE = %.2f , EF = %.2f , DF = %.2f\n" , DE , EF , DF) ;
// printf ("bata = %.2f\n" , bata * 180 / pi) ;
if (bata < )
printf ("%.2f\n" ,180.0 - bata) ;
else
printf ("%.2f\n" , bata) ;
}
return ;
}

标程中的大写字母表示角度,小写字母表示边长,注意0的特殊情况即可。

设CE = a = 1,AE = b,AC = c,BE = d,AB = e,AD = f,BD = g,DE = h

使用正弦定理可依次求出AE,AB,AD

然后利用余弦定理依次求出DE,∠AED

其他解法:建立坐标系搞,或者二分搞

acdream.18.KIDx's Triangle(数学推导)的更多相关文章

  1. 数学 ACdream 1196 KIDx's Triangle

    题目传送门 /* 这道题花了好长时间AC,思路有,但是表达式少写了括号一直乱码,囧! 注意:a==0时要特判:) */ #include <cstdio> #include <alg ...

  2. 杭赛.Triangle(数学推导)

    Triangle Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total S ...

  3. 借One-Class-SVM回顾SMO在SVM中的数学推导--记录毕业论文5

    上篇记录了一些决策树算法,这篇是借OC-SVM填回SMO在SVM中的数学推导这个坑. 参考文献: http://research.microsoft.com/pubs/69644/tr-98-14.p ...

  4. 关于不同进制数之间转换的数学推导【Written By KillerLegend】

    关于不同进制数之间转换的数学推导 涉及范围:正整数范围内二进制(Binary),八进制(Octonary),十进制(Decimal),十六进制(hexadecimal)之间的转换 数的进制有多种,比如 ...

  5. 模拟 ACdream 1196 KIDx's Pagination

    题目传送门 /* 简单模拟:考虑边界的情况输出的是不一样的,还有思维好,代码能短很多 */ #include <cstdio> #include <iostream> #inc ...

  6. UVA - 10014 - Simple calculations (经典的数学推导题!!)

    UVA - 10014 Simple calculations Time Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & ...

  7. 『sumdiv 数学推导 分治』

    sumdiv(POJ 1845) Description 给定两个自然数A和B,S为A^B的所有正整数约数和,编程输出S mod 9901的结果. Input Format 只有一行,两个用空格隔开的 ...

  8. LDA-线性判别分析(二)Two-classes 情形的数学推导

    本来是要调研 Latent Dirichlet Allocation 的那个 LDA 的, 没想到查到很多关于 Linear Discriminant Analysis 这个 LDA 的资料.初步看了 ...

  9. leetcode 343. Integer Break(dp或数学推导)

    Given a positive integer n, break it into the sum of at least two positive integers and maximize the ...

随机推荐

  1. JS的解析机制

    JS的解析机制,是JS的又一大重点知识点,在面试题中更经常出现,今天就来唠唠他们的原理.首先呢,我们在我们伟大的浏览器中,有个叫做JS解析器的东西,它专门用来读取JS,执行JS.一般情况是存在作用域就 ...

  2. 如何在WPF中引用Windows.System.Forms.Integration

    转自 http://www.cnblogs.com/sinozhang1988/archive/2012/11/28/2792804.html “未找到程序集 WindowsFormsIntegrat ...

  3. 集DDD,TDD,SOLID,MVVM,DI,EF,Angularjs等于一身的.NET(C#)开源可扩展电商系统–Virto Commerce

    今天一大早来看到园友分享的福利<分享一个前后端分离方案源码-前端angularjs+requirejs+dhtmlx 后端asp.net webapi>,我也来分享一个吧.以下内容由笔者写 ...

  4. 怎样写 OpenStack Neutron 的 Plugin (二)

    其实上一篇博文中的内容已经涵盖了大部分写Neutron插件的技术问题,这里主要还遗留了一些有关插件的具体实现的问题. 首先,Neutron对最基本的三个资源:Network, Port 和 Subne ...

  5. jdbc基础 (四) 批处理

    批处理,就是字面上的意思,一次性处理一批sql语句. 直接看例子吧: package com.cream.ice.jdbc; import java.sql.Connection; import ja ...

  6. css圆角矩形及去掉空格属性

    css圆角矩形 -webkit-border-radius:5px; -moz-border-radius:5px; border-radius:5px; 去掉空格 white-space:nowra ...

  7. [AHOI2013]立方体(三维bit)

    [Ahoi2013]立方体 Time Limit: 10 Sec  Memory Limit: 64 MBSubmit: 130  Solved: 55[Submit][Status] Descrip ...

  8. jQuery理解之(一)动画与特效

    本节主要降级和学习jQuery的自动显隐,渐入渐出.飞入飞出.自定义动画等. 1.显示和隐藏hide()和show() 对于动画来说,显示和隐藏是最基本的效果之一,本节简单介绍jQuery的显示和隐藏 ...

  9. Mysql 调优小技巧

    MySQL是一个功能强大的开源数据库.随着越来越多的数据库驱动的应用程序,人们一直在推动MySQL发展到它的极限.这里是101条调节和优化MySQL安装的技巧.一些技巧是针对特定的安装环境的,但这些思 ...

  10. MyEclipse 8.5配置Tomcat 7.0

    MyEclipse 8.5配置Tomcat 7.0 在窗口(Windows)->首选项(Prefrences)->MyEclipse->Servers->Tomcat 6.x下 ...