Euclid(几何)
http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2831
题意:已知A,B,C,D,E,F的坐标,求G,H的坐标,并且已知三角形DEF的面积等于平行四边形的面积,点H在AC上。
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <iostream>
#include <string.h>
using namespace std;
struct Point
{
double x,y;
Point(double x=,double y=):x(x),y(y) {}
};
typedef Point Vector; Vector operator -(Point a,Point b)
{
return Vector(a.x-b.x,a.y-b.y);
}
double Cross(Vector a,Vector b)
{
return (a.x*b.y-a.y*b.x);
}
int main()
{
double xa,ya,xb,yb,xc,yc,xd,yd,xe,ye,xf,yf;
while(cin>>xa>>ya>>xb>>yb>>xc>>yc>>xd>>yd>>xe>>ye>>xf>>yf)
{
if (xa==&&ya==&&xb==&&yb==&&xc==&&yc==&&xd==&&yd==&&xe==&&ye==&&xf==&&yf==)
break;
Point A(xa,ya),B(xb,yb),C(xc,yc),D(xd,yd),E(xe,ye),F(xf,yf);
Vector DE = E-D,DF= F-D,AB=B-A,AC=C-A;
double S1 = fabs(Cross(DE,DF))*/;
double S2 = fabs(Cross(AC,AB));
double k = S1/S2;
Vector AH(k*AC.x,k*AC.y);
Point H(AH.x+xa,AH.y+ya);
Point G(AB.x+H.x,AB.y+H.y);
printf("%.3f %.3f %.3f %.3f\n",G.x,G.y,H.x,H.y);
}
return ;
}
Euclid(几何)的更多相关文章
- sdut 2831 Euclid (几何)
题目:http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2831 题意:给a, b, c, d, ...
- 关于Three.js基本几何形状之SphereGeometry球体学习
一.有关球体SphereGeometry构造函数参数说明 <1>.SphereGeometry(radius, widthSegments, heightSegments, phiStar ...
- ZOJ1913 Euclid's Game (第一道简单的博弈题)
题目描述: Euclid's Game Time Limit: 2 Seconds Memory Limit: 65536 KB Two players, Stan and Ollie, p ...
- Euclid求最大公约数
Euclid求最大公约数算法 #include <stdio.h> int gcd(int x,int y){ while(x!=y){ if(x>y) x=x-y; else y= ...
- 几何服务,cut功能测试
关于几何服务 几何服务用于辅助应用程序执行各种几何计算,如缓冲区.简化.面积和长度计算以及投影.在 ArcGIS Server 管理器中启动几何服务之后,您才能够在应用程序开发过程中使用该服务. 问题 ...
- 几何服务,cut功能,输入要素target(修改后)内容。
几何服务,cut功能测试,输入要素target(修改后)内容. {"displayFieldName":"","fieldAliases": ...
- 几何服务,cut功能,输入要素target(修改前)内容。
几何服务,cut功能测试,输入要素target(修改前)内容. {"geometryType":"esriGeometryPolyline","geo ...
- HDU 1525 Euclid's Game 博弈
Euclid's Game Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Tot ...
- [poj2348]Euclid's Game(博弈论+gcd)
Euclid's Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 9033 Accepted: 3695 Des ...
随机推荐
- 最高的奖励 - 优先队列&贪心 / 并查集
题目地址:http://www.51cpc.com/web/problem.php?id=1587 Summarize: 优先队列&贪心: 1. 按价值最高排序,价值相同则按完成时间越晚为先: ...
- springboot+idea+jsp 404问题
我是这么解决的 对于单一项目,加入以下jar包即可. <!--前台页面的支持--> <dependency> <groupId>javax.servlet</ ...
- Linux 安装 MySQL 详解(rpm 包)
说明:Linux 系统中软件的安装在 root 用户下进行,此安装方式为 rpm 包方式,安装的版本为:MySQL-5.6.25-1.linux_glibc2.5.x86_64.rpm-bundle. ...
- Python爬虫常用库安装
建议更换pip源到国内镜像,下载会快很多:https://www.cnblogs.com/believepd/p/10499844.html requests pip3 install request ...
- 【转】精选十二款餐饮、快递、票务行业微信小程序源码demo推荐
微信小程序的初衷是为了线下实体业服务的,必须有实体相结合才能显示小程序的魅力.个人认为微信小程序对于餐饮业和快递业这样业务比较单一的行业比较有市场,故整理推荐12款餐饮业和快递业微信小程序源码demo ...
- A - Restaurant
UVA 1468 Description Mr. Kim is planning to open a new restaurant. His city is laid out as a grid ...
- vs2017 添加引用时 未能完成操作。不支持此接口
打开vs2017开发者命令提示符 切换至安装下的指定目录 执行下面的命令就可以了 需要注意的是一定要用vs2017的开发人员命令提示符 别用cmd gacutil -i Microsoft.V ...
- 【00】angular学习网站
[00] 学习资料: http://angularjs.cn/ 英文API:http://docs.angularjs.cn/api 中文API;http://www.apjs.n ...
- java增强for循环中获取index
java增强for循环中获取index http://rensanning.iteye.com/blog/2003205
- empty array & Array.from
empty array bug const duplicationArray = (arr = [], times = 2, debug = false) => { let result = [ ...