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. 记一些关于acm的小知识(自用,粗糙,勿点呀)

    #define INF 0x7ffffff,定义一个很大的数

  2. Daydreaming Stockbroker(2016 NCPC 贪心)

    题目: Gina Reed, the famous stockbroker, is having a slow day at work, and between rounds of solitaire ...

  3. bootstrap-table使用笔记

    服务端分页: //html <div class="container-fluid"> <div style="margin-top:1em" ...

  4. swiper.animate--css3翻页动画

    基于swiper 的 animate动画,适用于Swiper2.x和Swiper3.x . 1. 使用Swiper Animate需要先加载swiper.animate.min.js和animate. ...

  5. linux性能优化cpu-02平均负载

    每次我们系统变慢时,我们通常做的第一件事就是top命令或者uptime命令,看一下系统的负载情况,比如下面: 我在命令行中输入uptime 22:15:51    表示当前系统时间 up 13 min ...

  6. SQL学习笔记:一些高级语句

    现在以MySQL为模板.学习的方法和别的数据库写法上会有不同,但是思路基本一致. 用到的数据库表的格式: +----+--------------+-------------------------- ...

  7. 洛谷 1012 拼数(NOIp1998提高组)

    [题解] 我们要做的就是把这些数排序.排序的时候判断两个数是否交换的方法,就是把这两个数相接形成两个长度相同的数字,比较这两个数字的大小. #include<cstdio> #includ ...

  8. BZOJ 4385 洛谷3594 POI2015 WIL-Wilcze doły

    [题解] 手残写错调了好久QAQ...... 洛谷的数据似乎比较水.. n个正整数!!这很重要 这道题是个类似two pointer的思想,外加一个单调队列维护当前区间内长度为d的子序列中元素之和的最 ...

  9. 在 Oculus和 Gear VR上开发跨平台的 VR应用

    本文章由cartzhang编写,转载请注明出处. 所有权利保留. 文章链接:http://blog.csdn.net/cartzhang/article/details/51433994 作者:car ...

  10. 【OpenCV, MFC, DIP】向图像中加入各种噪声

    1.椒盐噪声 Mat dstImage = srcImage.clone(); ; k < n; k++) { //随机取值行列 int i = rand() % dstImage.rows; ...