码迷,mamicode.com
首页 >  
搜索关键字:circle    ( 1397个结果
简单的点与直线的几何模板
点到直线距离,直线相交交点,线段相交,向量点乘,向量叉乘,三角形有向面积,点到直线距离。struct point{ double x,y; point(double x=0,double y=0):x(x),y(y) { } }; typedef point V; struct circle{ point c; double r; circle(point c,double r):c(c),r(r...
分类:其他好文   时间:2015-03-10 19:29:32    阅读次数:132
VBS:Class、Public、Private
Class?Circle Public?r Private?mArea Public?Sub?Init(a) r=a End?Sub Public?Function?Area() If?mArea=""?Then ...
分类:其他好文   时间:2015-03-10 18:59:33    阅读次数:170
POJ 1981 Circle and Points
//对于任意一点已经覆盖了一些点的圆,都可以通过对圆进行偏移,以使其在保证已覆盖的点的基础上,覆盖更多的点 //对这偏移进行到极限,就是刚好使两点在圆上 //其实这题的思路和POJ1106是差不多的,只不过在看到聚会范围在[0,10]的时候想到随机算法去了 //还有一种n^2logn的做法,学习了一下圆上弧被覆盖次数的标记 #include #include #include using name...
分类:其他好文   时间:2015-03-08 14:23:26    阅读次数:227
SGU[130] CIrcle
Description描述On a circle border there are 2k different points A1, A2, ..., A2k, located contiguously. These points connect k chords so that each of po...
分类:其他好文   时间:2015-03-07 11:35:41    阅读次数:110
面向对象的设计技巧
1.面向对象设计把握一个重要的经验: 谁拥有数据,谁就对外提供操作这些数据的方法。2.面向对象对象的提炼经验: 名词提炼法。案例:1.人在黑板上画圆通过这一句话很容易想到这几个对象 person,blackboard,circle,接下来就是画圆draw()这个方法的描述应该...
分类:其他好文   时间:2015-03-02 18:24:36    阅读次数:178
JS面向对象5中写法
//定义Circle类,拥有成员变量r,常量PI和计算面积的成员函数area() //第1种写法function Circle(r) { this.r = r;}Circle.PI = 3.14159;Circle.prototype.area = function() { return...
分类:Web程序   时间:2015-03-02 14:41:53    阅读次数:160
POJ 1375 Intervals
解析几何,利用直角三角形asin函数求出角来,然后根据y就可以算出x了 最后把点排序一下,入点+1,出点-1,由0变为1则是入点,由1变为0时则是出点 #include #include #include #include using namespace std; struct Circle{ double x,y,r; }; struct Node{ double x; ...
分类:其他好文   时间:2015-02-27 10:12:45    阅读次数:120
有空就写个C++程序
近期工作变得轻松了非常多,有了一些空暇的时间,准备把大学时候的C++抓起来,而且研究研究算法:第一个C++程序:计算圆的面积,也是看其它的博客写出来的C++程序。#include#define pi 3.14using namespace std;class Circle { public : C....
分类:编程语言   时间:2015-02-25 18:34:59    阅读次数:145
J - Candy Sharing Game(模拟题)
主要是理解题目意思,然后就按照它说的来模拟就好了。 Description A number of students sit in a circle facing their teacher in the center. Each student initially has an even number of pieces of candy. When the teacher blo...
分类:其他好文   时间:2015-02-20 09:46:44    阅读次数:158
NYOJ 1165 just a problem【计算几何】
题目链接 #include #include struct point { double x; double y; }circle,a,b,c,d; double r; double dis(point &a,point &b) { return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y)); } in...
分类:其他好文   时间:2015-02-16 18:25:25    阅读次数:152
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!