zoukankan
html css js c++ java
JLU1205
垃圾几何题 JLU的题目不是叙述奇怪就是数据奇怪
WA估计是精度问题
#include
<
stdio.h
>
#include
<
string
.h
>
#include
<
math.h
>
struct
Point
{
float
x, y;
}
;
float
t;
float
aB;
float
moveA;
Point center;
float
y;
float
distan(Point p1, Point p2)
{
float
dis
=
(
float
)sqrt((p1.x
-
p2.x)
*
(p1.x
-
p2.x)
+
(p1.y
-
p2.y)
*
(p1.y
-
p2.y));
return
dis;
}
float
area()
{
float
A;
A
=
(
float
)(
2.0
*
acos(
-
1.0
)
-
2.0
*
(acos(y
/
432000.0
)));
float
Area1
=
A
/
2.0
*
432000.0
*
432000.0
;
Area1
+=
(
float
)(y
*
(
432000.0
*
sin(acos(y
/
432000.0
))));
float
result
=
(Area1
/
(acos(
-
1.0
)
*
432000.0
*
432000.0
));
if
(result
<
1
)
return
result;
else
return
1.0
;
}
void
run()
{
float
A
=
aB
-
moveA;
Point pc;
pc.x
=
(
float
)cos(A)
*
3950.0
;
pc.y
=-
(
float
)sin(A)
*
3950.0
;
float
lineA
=
(
float
)(acos(
-
1.0
)
-
(A
-
acos(
-
1.0
)
/
2.0
));
float
k
=
tan(lineA);
if
(tan(lineA)
>
acos(
-
1.0
))k
=
tan(lineA
-
acos(
-
1.0
));
y
=
k
*
(
92900000.0
-
pc.x)
+
pc.y;
if
(y
<
0
)
{
y
=-
y;
printf(
"
%lf\n
"
,
1.0
-
area());
}
else
printf(
"
%lf\n
"
,area());
}
void
begin()
{
float
a1 ,a2;
Point p1;
p1.x
=
92900000.0
,p1.y
=-
432000.0
;
a1
=
(
float
)acos(
3950.0
/
distan(center,p1));
a2
=
(
float
)asin(
432000.0
/
distan(center,p1));
aB
=
a1
+
a2;
}
int
main()
{
center.x
=
0.0
,center.y
=
0.0
;
begin();
while
(scanf(
"
%f
"
,
&
t)
==
1
)
{
moveA
=
2.0
*
t
*
acos(
-
1.0
)
/
(
24.0
*
3600.0
);
run();
}
return
0
;
}
查看全文
相关阅读:
mysql小数和类型转换函数
concat()用法
sql修改表名字段名
having函数,case when与order by
volatile实现原理与应用
synchronized的实现原理与应用
java8策略模式
centos7快速升级gcc
一个用户从发起请求到接收到响应,中间经过哪些服务,每个服务做什么事情
Java注解
原文地址:https://www.cnblogs.com/SQL/p/914257.html
最新文章
springBoot Ribbon Hystrix
springBoot Feign
springBoot Ribbon 负载均衡
编码问题(Encoding)
整除的尾数
半数集问题与动态规划
数组指针与二维数组的寻址
发工资咯
hbase java api 两种方式
sqlyog的连接完美版
热门文章
CentOS7安装Mysql并配置远程访问
CentOS7安装JDK1.8
Oracle VM VirtualBox安装CentOS7
CentOS7集群环境Elastic配置
jenkins配置windows节点遇到的问题
Python的is和==区别
Mysql区分大小写
Linux进程管理命令
top命令
LOCATE()和FIND_IN_SET()
Copyright © 2011-2022 走看看