uva1473 这题说的是 在空间中给了n个点 然后用体积最小的圆锥将这些点包含在内可以在表面上, 将这些点 映射到xoz平面上然后,然后枚举每个上凸包的边和每个点的极值进行判断求得最小的体积 我们会发现最小的体积 要不就紧贴一个点要不然就会贴住两个点

#include <iostream>
#include <cstdio>
#include <string.h>
#include <cmath>
#include <algorithm>
using namespace std;
const double INF =1.79769e+308;
const double eps = 0.000000000001;
int dcmp(double a)
{
if(fabs(a)<=eps) return ;
return a>?:-;
}
struct point {
double x,y;
point(double a=, double b=){
x=a; y=b;
}
point operator -(point A){
return point(x-A.x, y-A.y);
}
bool operator <(point A)const{
return dcmp(x-A.x)<||(dcmp(x-A.x)==&&dcmp(y-A.y)<=);
}
}P[],ch[];
int n;
double Cross(point A, point B)
{
return A.x*B.y-A.y*B.x;
}
int Conxtull(int &G)
{
sort(P,P+n);
int m=;
for(int i =; i<n ; ++i )
{
while(m>&&dcmp( Cross( ( ch[m-] - ch[m-] ), ( P[i] - ch[m-] ) ) )<=)m--;
ch[ m++ ] = P[i];
}
int k = m;
for(int i = n-; i>=; --i )
{
while( k<m&&dcmp( Cross( ch[m-]-ch[m-], P[i]-ch[m-] ) )<= ) m--;
ch[m++] = P[i] ;
}
if(n>)m--;
G=m;
return k-;
}
point getpoint(double k,point F)
{
point ans;
ans.x = F.x+(F.y/k);
ans.y = F.y+k*F.x;
return ans;
}
double Volun(double radio, double hight)
{
return acos(-)*radio*radio*hight/3.0;
}
double Volume,ansR,ansH;
void solve(double k,point T)
{
point e = getpoint(k,T);
double V =Volun(e.x,e.y);
if(dcmp(Volume-V)>){
ansR=e.x; ansH=e.y;
Volume=V;
}
}
int main()
{
freopen("data.in","r",stdin);
freopen("data.out","w",stdout);
while(scanf("%d",&n)==)
{
n++;
double Minx=0.0;
P[]=point(,);
for(int i = ; i<n; ++i)
{
double x,y,z;
scanf("%lf%lf%lf",&x,&y,&z);
P[i].x=sqrt(x*x+y*y);
P[i].y=z;
Minx = max(Minx,P[i].x);
}
int m;
int k =Conxtull(m);
ch[m]=ch[];
Volume=INF;
double K=INF;
int we;
for(int i=k; i<m; ++i )
{
if(i==m-||dcmp(ch[i].x-ch[i+].x)<=||dcmp(ch[i].y-ch[i+].y)>=)
{
we=i;
break;
}
double R =(ch[i+].y-ch[i].y)/(ch[i].x-ch[i+].x);
double t =ch[i].y*;
t/=ch[i].x;
int f1 =dcmp(t-R);
int f2=dcmp(t-K);
if(f1>=&&f2<=)
solve(t,ch[i]);
solve(R,ch[i]);
K=R;
}
double t = 2.0*ch[we].y/ch[we].x;
if(dcmp(t-K)<)
solve(t,ch[we]);
printf("%.3lf %.3lf\n",ansH,ansR);
} return ;
}

uva 12165 这题说的是  用梅涅劳斯 计算图中三角形的对应的比例列出一堆后 开始拆分那些边然后化简就会达到所要的公式

#include <iostream>
#include <string.h>
#include <cmath>
#include <cstdio>
using namespace std;
struct point{
double x,y;
point(double a=,double b=){
x=a; y =b;
}
point operator +(point A){
return point(x+A.x,y+A.y);
}
point operator -(point A){
return point(x-A.x,y-A.y);
}
point operator *(double A){
return point(x*A,y*A);
}
};
double Cross(point A,point B){
return A.x*B.y-A.y*B.x;
}
double Dot(point A,point B){
return A.x*B.x+A.y*B.y;
}
double Length(point A){
return sqrt(Dot(A,A));
}
int main()
{ double m1,m2,m3,m4,m5,m6;
point P,Q,R;
int cas;
scanf("%d",&cas);
for(int cc=; cc<=cas; ++cc){ scanf("%lf%lf%lf%lf%lf%lf",&P.x,&P.y,&Q.x,&Q.y,&R.x,&R.y);
scanf("%lf%lf%lf%lf%lf%lf",&m1,&m2,&m3,&m4,&m5,&m6);
double c =Length(P-Q),a =Length(R-Q), b =Length(P-R);
double m = m3*m5/(m6*(m3+m4));
double n = m4*m2/((m3+m4)*m1);
double BP = (c+m*c)/(n-m);
m = (m5*m1)/((m5+m6)*m2);
n = m6*m4/((m5+m6)*m3);
double CQ = (m*a+a)/(n-m);
m = m1*m3/((m1+m2)*m4);
n =m2*m6/((m1+m2)*m5);
double AR = (m*b+b)/(n-m);
point PR = (R-P)*(/Length(R-P));
point A = R +(PR*AR);
point QP = (P-Q)*(/Length(P-Q));
point B = P+(QP*BP);
point RQ = (Q-R)*(/Length(Q-R));
point C = Q+(RQ*CQ);
printf("%.8lf %.8lf %.8lf %.8lf %.8lf %.8lf\n",A.x,A.y,B.x,B.y,C.x,C.y);
} return ;
}

Geometry的更多相关文章

  1. CSharpGL(14)用geometry shader渲染模型的法线(normal)

    +BIT祝威+悄悄在此留下版了个权的信息说: CSharpGL(14)用geometry shader渲染模型的法线(normal) +BIT祝威+悄悄在此留下版了个权的信息说: 2016-08-13 ...

  2. the operation was attempted on an empty geometry Arcgis Project异常

    处理gis数据,投影变换时出现异常: the operation was attempted on an empty geometry 解决思路: arcgis的repair geometry方法:删 ...

  3. Topology and Geometry in OpenCascade-Adapters

    Topology and Geometry in OpenCascade-Adapters eryar@163.com 摘要Abstract:本文简要介绍了适配器模式(adapter pattern) ...

  4. HDU1086You can Solve a Geometry Problem too(判断线段相交)

    You can Solve a Geometry Problem too Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/3 ...

  5. <<Differential Geometry of Curves and Surfaces>>笔记

    <Differential Geometry of Curves and Surfaces> by Manfredo P. do Carmo real line Rinterval I== ...

  6. Geometry shader总结

    什么是Geometry Shader GS存在于vertext shader和固定功能vertex post-processing stage之间,它是可选的不是必要的.GS的输入是单个primiti ...

  7. Geometry Stage in Rendering pipeline (读书笔记2 --- Real-Time rendering)

    Geometry Stage一般包含下面几个阶段 1. Model & View Transform(模型和视图变换) --- 模型空间--> 世界空间 模型变换:每个模型经过模型变换来 ...

  8. WPF的二维绘图(二)——几何图形Geometry

    在WPF的DrawingContext对象中,提供了基本的绘制椭圆和矩形的API:DrawEllipse和DrawRectangle.但是,这些是远远不够用的,我们在日常应用中,更多的是使用DrawG ...

  9. Geometry关系高级操作

    一些高级的操作 几何形状Geometry缓冲(buffer) 线段的融合(linemerge)是将Geometry A中相互连接的线段进行连接 多边形化操作(polygonize)对Geometry ...

  10. java程序操作Geometry对象

    Geometry 空间地理对象,Oracle中存储Geometry对象的字段类型是 MDSYS.SDO_GEOMETRY,在数据库中构建Geometry对象的方法: v_pointarray MDSY ...

随机推荐

  1. Docker 容器管理:rancher

    Rancher:https://www.cnrancher.com/ 是一个开源的企业级全栈化容器部署及管理平台. 定位上和 K8s 比较接近,都是通过 web 界面赋予完全的 docker 服务编排 ...

  2. React 属性和状态的一些总结

    一.属性 1.第一种使用方法:键值对 <ClaaNameA name = “Tom” /> <ClaaNameA name = {Tom} /> <ClaaNameA n ...

  3. Accelerated Failure Time Models加速失效时间模型AFT

    Weibull distribution 或者 σ是未知的scale参数,独立于X的常量, σ>0 是服从某一分布的随机变量 残差(residuals)=

  4. Kafka在Linux上安装部署及样例测试

    Kafka是一个分布式的.可分区的.可复制的消息系统.它提供了普通消息系统的功能,但具有自己独特的设计.这个独特的设计是什么样的呢 介绍 Kafka是一个分布式的.可分区的.可复制的消息系统.它提供了 ...

  5. url写法细节

  6. 微软、谷歌、亚马逊、Facebook等硅谷大厂91个开源软件盘点(附下载地址)

    开源软件中有大量专家构建的代码,大大节省了开发人员的时间和成本,热衷于开源的大厂们总是能够带给我们新的惊喜.2016年9月GitHub报告显示,GitHub已经有超过 520 万的用户和超 30 万的 ...

  7. It is not based on WSGI, and it is typically run with only one thread per process.

    Tornado Web Server — Tornado 5.1.1 documentation http://www.tornadoweb.org/en/stable/

  8. 在浏览器地址栏输入一个URL后回车,将会发生的事情?

    https://yq.aliyun.com/articles/20667

  9. centos 7 yum configuration; yum localinstall

    Linux下对于软件包的管理使用rpm管理方式.直接使用rpm包管理工具来进行rpm包的安装,升级,卸载时,对于最让人头疼的莫过与包之间的依赖关系.yum作为一个rpm包前端管理工具,可以自动处理依赖 ...

  10. 网站优化不等于搜索引擎优化SEO

    对于SEO相信搞网络营销的人基本上都知道这个名词,英文全称为search engine optimization,中文一般叫搜索引擎优化,也有的叫搜索引擎定位(Search Engine Positi ...