bnu 10805 矩形神码的 平面向量的运行
矩形神码的
None
Graph Theory
2-SAT
Articulation/Bridge/Biconnected Component
Cycles/Topological Sorting/Strongly Connected Component
Shortest Path
Bellman Ford
Dijkstra/Floyd Warshall
Euler Trail/Circuit
Heavy-Light Decomposition
Minimum Spanning Tree
Stable Marriage Problem
Trees
Directed Minimum Spanning Tree
Flow/Matching
Graph Matching
Bipartite Matching
Hopcroft–Karp Bipartite Matching
Weighted Bipartite Matching/Hungarian Algorithm
Flow
Max Flow/Min Cut
Min Cost Max Flow
DFS-like
Backtracking with Pruning/Branch and Bound
Basic Recursion
IDA* Search
Parsing/Grammar
Breadth First Search/Depth First Search
Advanced Search Techniques
Binary Search/Bisection
Ternary Search
Geometry
Basic Geometry
Computational Geometry
Convex Hull
Pick's Theorem
Game Theory
Green Hackenbush/Colon Principle/Fusion Principle
Nim
Sprague-Grundy Number
Matrix
Gaussian Elimination
Matrix Exponentiation
Data Structures
Basic Data Structures
Binary Indexed Tree
Binary Search Tree
Hashing
Orthogonal Range Search
Range Minimum Query/Lowest Common Ancestor
Segment Tree/Interval Tree
Trie Tree
Sorting
Disjoint Set
String
Aho Corasick
Knuth-Morris-Pratt
Suffix Array/Suffix Tree
Math
Basic Math
Big Integer Arithmetic
Number Theory
Chinese Remainder Theorem
Extended Euclid
Inclusion/Exclusion
Modular Arithmetic
Combinatorics
Group Theory/Burnside's lemma
Counting
Probability/Expected Value
Others
Tricky
Hardest
Unusual
Brute Force
Implementation
Constructive Algorithms
Two Pointer
Bitmask
Beginner
Discrete Logarithm/Shank's Baby-step Giant-step Algorithm
Greedy
Divide and Conquer
Dynamic Programming
Tag it!
Input
Output
Sample Input
2
1.0 1.0 -1.0 -1.0 90.0
3.0 2.0 2.5 9.99 36.00
Sample Output
4.000000
18.835608
Hint
Source
Author
Tags ( Click to see)
初中知识,囧...我的数学
/*
刚开始,我居然不知道,矩阵对角线是一样长的,囧.画了一个圆,才知道。
刚开始,我居然不知道,c语言里cos()是用弧度的。囧。
暴力了数学的差。 向量的 AB=B-A;
第一种方法:向量法。
求出中点坐标,然后根据向量求出另一个点。
第二种方法:s=1/2*a*b*sinc; */ //第一种
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<math.h>
using namespace std; double pi=acos(-1.0); int main()
{
int t;
double x1,y1,x2,y2,theta;
double avex,avey,hxl,tom,x3,y3,x4,y4;
while(scanf("%d",&t)>)
{
while(t--)
{
scanf("%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&theta);
theta=theta/*pi;
avex=(x1+x2)/;
avey=(y1+y2)/;
x4=x2-avex;//向量坐标
y4=y2-avey; x3=x4*cos(theta)-y4*sin(theta);
y3=x4*sin(theta)+y4*cos(theta);
x3=x3+avex;
y3=y3+avey; hxl=sqrt( (x3-x1)*(x3-x1)+(y3-y1)*(y3-y1) );
tom=sqrt( (y3-y2)*(y3-y2)+(x3-x2)*(x3-x2) ); printf("%.6lf\n",hxl*tom);
}
}
return ;
}
bnu 10805 矩形神码的 平面向量的运行的更多相关文章
- BNU10805:矩形神码的
我们都知道,矩形是由两条对角线的,没错吧?(谜之声:这不是显然么!)这两条线的长度也是相等的,没错吧?(谜之声:这不废话么!)然后我们给定一条对角线的起始点和终止点的坐标,然后给定另一个对角线和他的夹 ...
- 源码深度解析SpringMvc请求运行机制(转)
源码深度解析SpringMvc请求运行机制 本文依赖的是springmvc4.0.5.RELEASE,通过源码深度解析了解springMvc的请求运行机制.通过源码我们可以知道从客户端发送一个URL请 ...
- 转:[gevent源码分析] 深度分析gevent运行流程
[gevent源码分析] 深度分析gevent运行流程 http://blog.csdn.net/yueguanghaidao/article/details/24281751 一直对gevent运行 ...
- 老李推荐:第8章7节《MonkeyRunner源码剖析》MonkeyRunner启动运行过程-小结
老李推荐:第8章7节<MonkeyRunner源码剖析>MonkeyRunner启动运行过程-小结 poptest是国内唯一一家培养测试开发工程师的培训机构,以学员能胜任自动化测试,性 ...
- 老李推荐:第8章5节《MonkeyRunner源码剖析》MonkeyRunner启动运行过程-运行测试脚本
老李推荐:第8章5节<MonkeyRunner源码剖析>MonkeyRunner启动运行过程-运行测试脚本 poptest是国内唯一一家培养测试开发工程师的培训机构,以学员能胜任自动化 ...
- 老李推荐:第8章1节《MonkeyRunner源码剖析》MonkeyRunner启动运行过程-运行环境初始化
老李推荐:第8章1节<MonkeyRunner源码剖析>MonkeyRunner启动运行过程-运行环境初始化 首先大家应该清楚的一点是,MonkeyRunner的运行是牵涉到主机端和目 ...
- Ubuntu TensorFlow 源码 Android Demo的编译运行
Ubuntu TensorFlow 源码 Android Demo的编译运行 一. 安装 Android 的SDK和NDK SDK 配置 A:下载 国内下载地址选最新的: SDK: https://d ...
- Spark源码分析之八:Task运行(二)
在<Spark源码分析之七:Task运行(一)>一文中,我们详细叙述了Task运行的整体流程,最终Task被传输到Executor上,启动一个对应的TaskRunner线程,并且在线程池中 ...
- {bzoj2338 [HNOI2011]数矩形 && NBUT 1453 LeBlanc}平面内找最大矩形
思路: 枚举3个点,计算第4个点并判断是否存在,复杂度为O(N3logN)或O(N3α) 考虑矩形的对角线,两条对角线可以构成一个矩形,它们的长度和中点必须完全一样,于是将所有线段按长度和中点排序,那 ...
随机推荐
- 《快学Scala》第八章 继承
- php性能优化三(PHP语言本身)
0.用单引号代替双引号来包含字符串,这样做会更快一些.因为PHP会在双引号包围的字符串中搜寻变量,单引号则不会,注意:只有echo能这么做,它是一种可以把多个字符串当作参数的“函数”(译注:PHP手册 ...
- python 第一天学习(画个正方体)
import turtleturtle.goto(200,0)turtle.goto(200,200)turtle.goto(0,200)turtle.goto(0,0)turtle.penup()t ...
- windows 域的安装方法
前面的博客中我们知道了 Windows AD域的升级,下面我谈谈Windows域的安装和卸载. 卸载AD域 配置备份AD域 安装子域 删除子域(必须在根域管理员模式下删除,否则无法删除) 删除命令 导 ...
- leetcode-733-Flood Fill
题目描述: An image is represented by a 2-D array of integers, each integer representing the pixel value ...
- js 的概念和声明-js 的变量-js 的运算符和逻辑结构-js 的数组
js 的概念和声明Js的概念和声明:问题:在网页的发展历程中,发现网页不能对用户的数据进行自动校验,和提供一些特效造成用户体验极差解决:使用JavaScript作用:可以让网页和用户之间进行直接简单的 ...
- Django 登陆注册实现
路由层 from django.conf.urls import url from django.contrib import admin from app01 import views urlpat ...
- 搭建类似生产环境的RAC
install the necessary packages yum install -y 创建组.用户和目录 创建用户组 groupadd -g 2000 oinstallgroupadd -g 2 ...
- com.alibaba.dubbo.rpc.RpcException: Failed to invoke remote method解决方法
报错日记: Caused by: com.alibaba.dubbo.rpc.RpcException: Failed to invoke remote method: getUserAuthLeve ...
- emacs26.1 ppa
sudo add-apt-repository ppa:kelleyk/emacssudo apt updatesudo apt install emacs26