B - Counterclockwise Rotation(计算几何)

网友投稿 738 2022-11-16

B - Counterclockwise Rotation(计算几何)

B - Counterclockwise Rotation(计算几何)

B - Counterclockwise Rotation(计算几何)

可以转极坐标。

一开始没注意 counterclockwise 是逆时针的意思qwq

// Problem: B - Counterclockwise Rotation// Contest: AtCoder - AtCoder Beginner Contest 259// URL: Memory Limit: 1024 MB// Time Limit: 2000 ms// Date: 2022-07-13 15:26:41// --------by Herio--------#includeusing namespace std;typedef long long ll;typedef unsigned long long ull; const int N=1e3+5,M=2e4+5,inf=0x3f3f3f3f,mod=1e9+7;const int hashmod[4] = {402653189,805306457,1610612741,998244353};#define mst(a,b) memset(a,b,sizeof a)#define db double#define PII pair#define PLL pair#define x first#define y second#define pb emplace_back#define SZ(a) (int)a.size()#define rep(i,a,b) for(int i=a;i<=b;++i)#define per(i,a,b) for(int i=a;i>=b;--i)#define IOS ios::sync_with_stdio(false),cin.tie(nullptr)void Print(int *a,int n){ for(int i=1;i //x=max(x,y) x=min(x,y)void cmx(T &x,T y){ if(xvoid cmn(T &x,T y){ if(x>y) x=y;}const double pi = acos(-1.0);int main(){ int x,y,d;cin>>x>>y>>d; double r = sqrt(x*x+y*y); double p = atan2(y,x); //printf("%f---\n",atan2(0,0)); p+=d*pi/180; printf("%.10f %.10f\n",r*cos(p),r*sin(p)); return 0;}

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:消费Kafka数据Flume
下一篇:springboot集成Ztree-V3【数插件】开发web项目
相关文章

 发表评论

暂时没有评论,来抢沙发吧~