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(几何)的更多相关文章

  1. sdut 2831 Euclid (几何)

    题目:http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2831 题意:给a, b,  c,  d, ...

  2. 关于Three.js基本几何形状之SphereGeometry球体学习

    一.有关球体SphereGeometry构造函数参数说明 <1>.SphereGeometry(radius, widthSegments, heightSegments, phiStar ...

  3. ZOJ1913 Euclid's Game (第一道简单的博弈题)

    题目描述: Euclid's Game Time Limit: 2 Seconds      Memory Limit: 65536 KB Two players, Stan and Ollie, p ...

  4. Euclid求最大公约数

    Euclid求最大公约数算法 #include <stdio.h> int gcd(int x,int y){ while(x!=y){ if(x>y) x=x-y; else y= ...

  5. 几何服务,cut功能测试

    关于几何服务 几何服务用于辅助应用程序执行各种几何计算,如缓冲区.简化.面积和长度计算以及投影.在 ArcGIS Server 管理器中启动几何服务之后,您才能够在应用程序开发过程中使用该服务. 问题 ...

  6. 几何服务,cut功能,输入要素target(修改后)内容。

    几何服务,cut功能测试,输入要素target(修改后)内容. {"displayFieldName":"","fieldAliases": ...

  7. 几何服务,cut功能,输入要素target(修改前)内容。

    几何服务,cut功能测试,输入要素target(修改前)内容. {"geometryType":"esriGeometryPolyline","geo ...

  8. HDU 1525 Euclid's Game 博弈

    Euclid's Game Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Tot ...

  9. [poj2348]Euclid's Game(博弈论+gcd)

    Euclid's Game Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 9033   Accepted: 3695 Des ...

随机推荐

  1. 用python写了一个猜年龄小游戏

    写一个猜年龄游戏: 需要实现用户登录的功能 初始用户登录信息为 {'hades': '13579','nick': '123','ruixing': 'a1','fanping': 'b2'} 登录时 ...

  2. HDU 5178 pairs(双指针)

    HDU 5178 pairs(双指针) Hdu 5178 解法:因为要求的是绝对值小于等于k,因此数字的序号关系并不重要,那么排序后使用双指针即可解决这个问题. #include<queue&g ...

  3. HDU 1059 多重背包问题

    问题大意: 有价值1-6的六种物品,分别规定其数目,问是否存在一种方法能使这些物品不拆分就能平均分给两个人 #include <cstdio> #include <cstring&g ...

  4. Shortest Prefixes(poj 2001)

    题意:给出n个单词(1<=n<=1000),求出每个单词的非公共前缀,如果没有,则输出自己. /* 字典树 在裸字典树的基础上,设置一个sum数组,sum[i]表示i这个节点被用过几次,当 ...

  5. UIColor用自定义颜色,TableView去掉背景色

    1.用mac系统自带的数码测色计,选RGB模式,将值添加到ColorWithRed:xxx.0/255 最后的alpha选1.0 2.TableView的背景色要用setBackgroundView的 ...

  6. zoj——1202 Divide and Count

    Divide and Count Time Limit: 2 Seconds      Memory Limit: 65536 KB Jack has several beautiful diamon ...

  7. Ubuntu中PPA源是什么

    以下内容转自https://imcn.me/ppa: PPA是Personal Package Archives首字母简写.翻译为中文意思是:个人软件包文档 只有Ubuntu用户可以用,而所有的PPA ...

  8. HDFS v1.0学习笔记

    hdfs是一个用于存储大文件的分布式文件系统,是apache下的一个开源项目,使用java实现.它的设计目标是可以运行在廉价的设备上,运行在大多数的系统平台上,高可用,高容错,易于扩展. 适合场景 存 ...

  9. laravel5.5更新到laravel5.7

    为什么要更新呢?因为项目用的第三方后台扩展包,有很些bug,不够完美.想要一个漂亮的后台,那个后台只支持5.7. 然后,我就开始更新框架了. 修改后:"php": "&g ...

  10. 关于SVN版本冲突问题

    版本冲突原因: 假设A.B两个用户都在版本号为100的时候,更新了kingtuns.txt这个文件,A用户在修改完成之后提交kingtuns.txt到服务器,这个时候提交成功,这个时候kingtuns ...