当前位置:网站首页>Code shoe set precision barrage
Code shoe set precision barrage
2022-07-25 22:55:00 【Elvin domain text】
The key here is to deal with the slope and angle
See the following link for specific usage
#include<bits/stdc++.h>
using namespace std;
#define PI 3.14159265
int main( )
{
double x,y,r,xt,yt;
double k;
cin >> x >> y >> r >> k >> xt >> yt;
double y1,x1, y2, x2;
double a;
a = atan(k)*180/PI;
a = 90.0-a;
if(k>0){
x1 = x+r*cos(a*PI/180);
y1 = y-r*sin(a*PI/180);
x2 = x-r*cos(a*PI/180);
y1 = y+r*sin(a*PI/180);
y1 = k*(xt-x1)+y1;
y2 = k*(xt-x2)+y2;
if((y1<=yt and y2>=yt) or(y1>=yt and y2<=yt)){
cout << 1;
}
else{
cout << 0;
}
}
if(k<0){
x1 = x-r*cos(a*PI/180);
y1 = y-r*sin(a*PI/180);
x2 = x+r*cos(a*PI/180);
y2 = y+r*sin(a*PI/180);
y1 = k*(xt-x1)+y1;
y2 = k*(xt-x2)+y2;
if((y1<=yt and y2>=yt) or (y1>=yt and y2<=yt)){
cout << 1;
}
else{
cout << 0;
}
}
if(k==0) {
if(yt>=y-r and yt <=y+r){
cout << 1;
}
else{
cout << 0;
}
}
return 0;
}边栏推荐
- MySQL data type
- CUDA environment construction
- 软件测试 pytest pytest的命名规则 用例的前后置 conftest.py 定制allure报告 @pytest.mark.parametrize()装饰器作数据驱动
- Network Security Learning (XII) OSI and TCP
- Solve several common problems
- [training day15] paint road [minimum spanning tree]
- JD quick navigation box
- Qt5.12 installation error prompt: c:\qt5.12.11\vcredist\vcredist_ msvc2019_ x86.exe /norestart /q
- Experiment 1, experiment 2 and Experiment 3 of assembly language and microcomputer principle: branch program design / loop program design / subroutine design
- JSON object
猜你喜欢
![[training Day12] tree! Tree! Tree! [greed] [minimum spanning tree]](/img/46/1c7f6abc74e11c4c2e09655aade223.png)
[training Day12] tree! Tree! Tree! [greed] [minimum spanning tree]

互联网协议之 IPFS

自媒体人必备的4个素材网站,再也不用担心找不到素材

自媒体人必备的4个资源工具,每一个都很实用

Anaconda~Upload did not complete.
![[training day15] good name [hash]](/img/62/5cd354e63aab861bf8fa1f265b6986.png)
[training day15] good name [hash]

栈与Stack类

Von Neumann architecture

Madness. MySQL learning.

Two methods of printing strings in reverse order in C language
随机推荐
Network Security Learning (XIV) IP protocol
互联网协议之 IPFS
[training day13] travel [violence] [dynamic planning]
[training day15] paint road [minimum spanning tree]
ECMA 262 12 Lexical Grammer
Learning orientation today
The difference between overloading and rewriting
[MySQL rights] UDF rights (with Malaysia)
如何获取广告服务流量变现数据,助力广告效果分析?
力扣解法汇总919-完全二叉树插入器
Opencv compile and call GPU version
Simple setting method of search box
TFrecord写入与读取
QVariant的使用
Kibana~ the process number cannot be found after kibana is started in the background
Can generic types be used in array
Simulated Xiaomi mall head home page
Today, learn about the use of lists, hyperlinks, image tags, and audio and video
The third programming competition of Wuhan University of technology b- save the kingdom of DAG (topological properties deal with accessibility Statistics)
Anaconda~Upload did not complete.