当前位置:网站首页>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;
}边栏推荐
猜你喜欢

【论文笔记】基于在线预测和规划的机器人动态跟踪抓取方法

Simple setting method of search box

Network Security Learning (XIII) data link layer

Deep recursion, deep search DFS, backtracking, paper cutting learning.

贴片微型滚珠振动开关的结构原理

CUDA environment construction
![[training day15] good name [hash]](/img/62/5cd354e63aab861bf8fa1f265b6986.png)
[training day15] good name [hash]

The fourth experiment nat

QT的Tree View Model示例

Opencv compile and call GPU version
随机推荐
MatrixCube揭秘102——300行实现的完整分布式存储系统MatrixKV
CSV intro
我们为什么要推出Getaverse?
Recyclerview computehorizontalscrollextend computehorizontalscrollrange computehorizontalscroll for calculating the sliding distance
Learning orientation today
Network Security Learning (XII) OSI and TCP
Use of qvariant
1000 okaleido tiger launched binance NFT, triggering a rush to buy
Simple setting method of search box
3 lexical analysis
We media people must have four material websites, and don't worry about finding materials anymore
Hcie is finally in hand, and the road begins
Interview question 17.11. word distance ●●
Kibana~ the process number cannot be found after kibana is started in the background
CUDA environment construction
JVM memory area
Network Security Learning (XIV) IP protocol
互联网协议之 IPFS
Summary of common methods of string:
Express framework