Problem Description

Ignatius bought a land last week, but he didn't know the area of the land because the land is enclosed by a parabola and a straight line. The picture below shows the area. Now given all the intersectant points shows in the picture, can you tell Ignatius the
area of the land?



Note: The point P1 in the picture is the vertex of the parabola.





Input

The input contains several test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow.

Each test case contains three intersectant points which shows in the picture, they are given in the order of P1, P2, P3. Each point is described by two floating-point numbers X and Y(0.0<=X,Y<=1000.0).

Output

For each test case, you should output the area of the land, the result should be rounded to 2 decimal places.

Sample Input

2
5.000000 5.000000
0.000000 0.000000
10.000000 0.000000
10.000000 10.000000
1.000000 1.000000
14.000000 8.222222

Sample Output

33.33
40.69
///////抽象出公式
#include <iostream>
using namespace std;
int main()
{ int t;
double x1,y1,x2,y2,x3,y3,a,k,s;
cin>>t;
while(t--)
{ cin>>x1>>y1>>x2>>y2>>x3>>y3;
a=(y2-y1)/((x2-x1)*(x2-x1));
k=(y2-y3)/(x2-x3);
s=a/3*(x3*x3*x3-x2*x2*x2)+(a*x1*x1+k*x3+y1-y3)*(x3-x2)+0.5*(2*a*x1+k)*(x2*x2-x3*x3);
printf("%.2f\n",s);
}
return 0;
}

The area面积计算的更多相关文章

  1. (easy)LeetCode 223.Rectangle Area

    Find the total area covered by two rectilinear rectangles in a 2D plane. Each rectangle is defined b ...

  2. sdut 3-4 长方形的周长和面积计算

    3-4 长方形的周长和面积计算 Time Limit: 1000MS Memory limit: 65536K 标题叙述性说明 通过本题的练习能够掌握拷贝构造函数的定义和用法: 设计一个长方形类Rec ...

  3. SkylineGlobe Android 开发 面积计算示例代码

    SkylineGlobe Android 开发 面积计算示例代码: 如果之前熟悉SkylineGlobe桌面端的二次开发,看这些代码应该不难理解. package com.skyline.terrae ...

  4. GIS面积计算问题

    好长时间不更新了,今天说点干货,项目用到的. 1.项目中要用到计算面积的,根据火星坐标: 2.百度找了各种面积计算,google了半天,也没发现那个比较准确: 直接说干货吧.咱也高大上一会,用 Arc ...

  5. [转]NopCommerce How to add a menu item into the administration area from a plugin

    本文转自:http://docs.nopcommerce.com/display/nc/How+to+code+my+own+shipping+rate+computation+method Go t ...

  6. ASP.NET MVC系列:Area

    1. Area简介 ASP.NET MVC Area机制构建项目,可以将相对独立的功能模块切割划分,降低项目的耦合度. 2. Area设置Routing 新建Admin Area后,自动创建Admin ...

  7. Web API项目中使用Area对业务进行分类管理

    在之前开发的很多Web API项目中,为了方便以及快速开发,往往把整个Web API的控制器放在基目录的Controllers目录中,但随着业务越来越复杂,这样Controllers目录中的文件就增加 ...

  8. MVC View中获取action、controller、area名称

    获取控制器名称: ViewContext.RouteData.Values["controller"].ToString(); 获取Action名称: ViewContext.Ro ...

  9. [LeetCode] Rectangle Area 矩形面积

    Find the total area covered by two rectilinear rectangles in a2D plane. Each rectangle is defined by ...

随机推荐

  1. Nagios的客户端的安装

    一.Linux服务器的nagios客户端的安装 步骤: 1.  创建目录,上传文件到该目录 mkdir /data nagios-plugins-2.1.1.tar.gz nrpe-2.12.tar. ...

  2. Codeforces 461B - Appleman and Tree 树状DP

    一棵树上有K个黑色节点,剩余节点都为白色,将其划分成K个子树,使得每棵树上都仅仅有1个黑色节点,共同拥有多少种划分方案. 个人感觉这题比較难. 如果dp(i,0..1)代表的是以i为根节点的子树种有0 ...

  3. I2C分析三

    1 引言 IIC (Inter-Integrated Circuit1总线是一种由Philips公司开发的2线式串行总线,用于连接微控制器及其外围设备.它是同步通信的一种特殊形式,具有接口线少.控制方 ...

  4. The Django template language 阅读批注

    The Django template language About this document This document explains the language syntax of the D ...

  5. SQL Server Compact免安装部署

    原文:SQL Server Compact免安装部署 情况 应用程序中的EF使用了SQL Server Compact,打包部署到客户机器上后提示数据库连接异常,信息类似”配置节“.”Provider ...

  6. 2012 PHP热门资料64个+经典源码50个——下载目录 :

    完整附件0豆下载:http://down.51cto.com/data/419216 附件部分预览: PHP精彩应用实例程序源码集锦 http://down.51cto.com/zt/39 无师自通: ...

  7. 压缩js参数保存解决方法

    angular.js  中 找到 if (typeof fn === 'function') 在 if (fn.length) { console.warn("此函数没有注入注解,将导致编译 ...

  8. hdu 5017 Ellipsoid(西安网络赛 1011)

    Ellipsoid Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total ...

  9. zoj3822 期望dp

    每天在一个n*m的棋盘上放棋子,问使得每一行,每一列都有棋子的期望天数 dp[n][m][k] 表示用k个棋子占据了n行,m列,距离目标状态还需要的期望天数 那么dp[n][m][k] = p1 * ...

  10. MD5加密,解密

    using System; using System.Collections.Generic; using System.Text; using System.Globalization; using ...