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α) 考虑矩形的对角线,两条对角线可以构成一个矩形,它们的长度和中点必须完全一样,于是将所有线段按长度和中点排序,那 ...
随机推荐
- 调用jdbc已经写成的方法----jdbc工具类抽取方式二
先创建db.properties driver=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/web08?useUnicode=true& ...
- MySQL数据库管理
好记性不如烂笔头 1.MySQL启动基本原理 /etc/init.d/mysqld 是一个shell启动脚本,启动后会调用mysqld_safe脚本,最后调用的是mysqld主程序启动mysql. 单 ...
- django在model中添加字段报错
在以下类中添加 description 字段后, class Colors(models.Model): colors = models.CharField(u'颜色', max_length=10) ...
- Python【每日一问】17
问: [基础题]:简述Python的异常处理机制[提高题]:请实现一个函数,将一个字符串中的空格替换成“%20”.例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%2 ...
- python 报错: Dog() takes no arguments
后来上网找了一下.发现是 构造方法 __init__ 两边的下划线是双下划线,我写的是单下划线. 读书不认真,该打. 特此记录.
- C# GDI+开发手记
创建画布画字体文字区域内居中换行文字在整个画布中居中画直线画圆形头像压缩保存图片缩放旋转单位换算 创建画布 Bitmap image = new Bitmap(640, 1136, PixelForm ...
- mac下抓包工具charles
图片没带过来,想看截图的可以直接点击有道云笔记的链接: http://note.youdao.com/share/?id=f5c7369a0c1e1e37cdcd08a04d33be7e 1.下载 h ...
- js中的正则表达式【常用】
正则表达式是一种用于处理字符串匹配的强大工具,正则的核心在于匹配语法. 以下是常用的匹配规则 . 除了换行符之外的任意一个字符 \ 转义符,取消后面一个字符的含义,使其成为一个普通字符 [] 括号里的 ...
- vue构造器以及实例属性
一.构造器 1.vue.js就是一个构造器,通过构造器Vue来实例化一个对象:例如:var vm = new Vue({}); 2.实例化Vue时,需要传入一个参数(选项对象): 3.参数:选项对象可 ...
- 将静态网页部署到git上访问
1.将已有的项目放在github上 http://www.cnblogs.com/zqunor/p/6583182.html 2.出现错误解决方案 提交错误 http://blog.csdn.net/ ...