虫虫首页| 资源下载| 资源专辑| 精品软件
登录| 注册

PI

圆周率(PI)是圆的周长与直径的比值,一般用希腊字母π表示,是一个在数学及物理学中普遍存在的数学常数。π也等于圆形之面积与半径平方之比,是精确计算圆周长、圆面积、球体积等几何形状的关键值。在分析学里,π可以严格地定义为满足sinx=0的最小正数x。
  • (1) 实现一个Point类

    (1) 实现一个Point类,该类包含表示坐标的两个int型变量x、y,构造方法Point()和Point(int xx, int yy),返回x值和y值的int getX()和int getY()方法,计算两点间距离的double distance(Point)方法。其中计算平方根用Math.sqrt()方法。 (2) 实现一个Circle类,该类包含表示圆心的Point型变量center,表示半径的int radius变量,以及构造方法Circle()、Circle(int xx,int yy,int r)、Circle(Point c,int r),返回周长和面积的int perimeter()、double area()方法,返回两个圆是否为同一个圆(返回0)、同心圆(返回1)、相交的圆(返回2)、分离的圆(返回3)、包含的圆(返回4)等关系的int relation(Circle c)等方法。PI值可以用Math.PI常量。 (3) 实现测试上述两个类的ClassTest类。该类在main方法中分别创建若干个Point对象和Circle对象,并调用相关方法,输出方法的返回值,验证其正确性。 (4) 将Point类、Circle类和主类的包名分别调整为p1、p2、p3,并重新运行,验证是否运行正确。

    标签: Point

    上传时间: 2014-11-25

    上传用户:cylnpy

  • 一被控对象

    一被控对象 ,给定为阶跃给定,幅值为500,设计一个两维模糊PI型控制器,输入语言变量和输出语言变量均取7个值{NB,NM,NS,ZE,PS,PM,PB},模糊论域为{-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6},用matlab编程仿真研究。

    标签: 对象

    上传时间: 2013-12-16

    上传用户:大融融rr

  • private double PointToAngle(Point AOrigin, Point APoint) { if (APoint.X == AOrigin.X) if (APoin

    private double PointToAngle(Point AOrigin, Point APoint) { if (APoint.X == AOrigin.X) if (APoint.Y > AOrigin.Y) return Math.PI * 0.5f else return Math.PI * 1.5f else if (APoint.Y == AOrigin.Y) if (APoint.X > AOrigin.X) return 0 else return Math.PI else {

    标签: AOrigin APoint Point PointToAngle

    上传时间: 2016-10-31

    上传用户:zhyiroy

  • private double PointToAngle(Point AOrigin, Point APoint) { if (APoint.X == AOrigin.X) if (APoin

    private double PointToAngle(Point AOrigin, Point APoint) { if (APoint.X == AOrigin.X) if (APoint.Y > AOrigin.Y) return Math.PI * 0.5f else return Math.PI * 1.5f else if (APoint.Y == AOrigin.Y) if (APoint.X > AOrigin.X) return 0 else return Math.PI else {

    标签: AOrigin APoint Point PointToAngle

    上传时间: 2016-10-31

    上传用户:sunjet

  • private double PointToAngle(Point AOrigin, Point APoint) { if (APoint.X == AOrigin.X) if (APoin

    private double PointToAngle(Point AOrigin, Point APoint) { if (APoint.X == AOrigin.X) if (APoint.Y > AOrigin.Y) return Math.PI * 0.5f else return Math.PI * 1.5f else if (APoint.Y == AOrigin.Y) if (APoint.X > AOrigin.X) return 0 else return Math.PI else {

    标签: AOrigin APoint Point PointToAngle

    上传时间: 2013-12-18

    上传用户:rocketrevenge

  • For solving the following problem: "There is No Free Lunch" Time Limit: 1 Second Memory Limit: 3

    For solving the following problem: "There is No Free Lunch" Time Limit: 1 Second Memory Limit: 32768 KB One day, CYJJ found an interesting PIece of commercial from newspaper: the Cyber-restaurant was offering a kind of "Lunch Special" which was said that one could "buy one get two for free". That is, if you buy one of the dishes on their menu, denoted by di with price PI , you may get the two neighboring dishes di-1 and di+1 for free! If you PIck up d1, then you may get d2 and the last one dn for free, and if you choose the last one dn, you may get dn-1 and d1 for free. However, after investigation CYJJ realized that there was no free lunch at all. The price PI of the i-th dish was actually calculated by adding up twice the cost ci of the dish and half of the costs of the two "free" dishes. Now given all the prices on the menu, you are asked to help CYJJ find the cost of each of the dishes.

    标签: Limit following solving problem

    上传时间: 2014-01-12

    上传用户:362279997

  • it is a simulation about ML synchronization algorithm in OFDM systems,you can slao see a function PI

    it is a simulation about ML synchronization algorithm in OFDM systems,you can slao see a function PIcture in its output,that s useful for a beginner

    标签: synchronization simulation algorithm function

    上传时间: 2013-12-17

    上传用户:yulg

  • Euler函数: m = p1^r1 * p2^r2 * …… * pn^rn ai >= 1 , 1 <= i <= n Euler函数: 定义:phi(m) 表示小于等

    Euler函数: m = p1^r1 * p2^r2 * …… * pn^rn ai >= 1 , 1 <= i <= n Euler函数: 定义:phi(m) 表示小于等于m并且与m互质的正整数的个数。 phi(m) = p1^(r1-1)*(p1-1) * p2^(r2-1)*(p2-1) * …… * pn^(rn-1)*(pn-1) = m*(1 - 1/p1)*(1 - 1/p2)*……*(1 - 1/pn) = p1^(r1-1)*p2^(r2-1)* …… * pn^(rn-1)*phi(p1*p2*……*pn) 定理:若(a , m) = 1 则有 a^phi(m) = 1 (mod m) 即a^phi(m) - 1 整出m 在实际代码中可以用类似素数筛法求出 for (i = 1 i < MAXN i++) phi[i] = i for (i = 2 i < MAXN i++) if (phi[i] == i) { for (j = i j < MAXN j += i) { phi[j] /= i phi[j] *= i - 1 } } 容斥原理:定义phi(p) 为比p小的与p互素的数的个数 设n的素因子有p1, p2, p3, … pk 包含p1, p2…的个数为n/p1, n/p2… 包含p1*p2, p2*p3…的个数为n/(p1*p2)… phi(n) = n - sigm_[i = 1](n/PI) + sigm_[i!=j](n/(PI*pj)) - …… +- n/(p1*p2……pk) = n*(1 - 1/p1)*(1 - 1/p2)*……*(1 - 1/pk)

    标签: Euler lt phi 函数

    上传时间: 2014-01-10

    上传用户:wkchong

  • 计算全息close all clc clear A=zeros(64) A(15:20,20:40)=1 A(15:50,20:25)=1 A(45:50,20:40)=1 A(30:34,

    计算全息close all clc clear A=zeros(64) A(15:20,20:40)=1 A(15:50,20:25)=1 A(45:50,20:40)=1 A(30:34,20:35)=1 % ppp=exp(rand(64)*PI*2*i) A=A.*ppp % Author s email: zjliu2001@163.com figure imshow(abs(A),[]) Fa=fft2(fftshift(A)) Fs=fftshift(Fa) Am=abs(Fs) % amplitude Ph=angle(Fs) % phase s=11 % 这表示边长吗? cgh=zeros(64*s) th=max(max(abs(Fs)))

    标签: 20 close clear zeros

    上传时间: 2014-10-13

    上传用户:wweqas

  • // 入口参数: // l: l = 0, 傅立叶变换 l = 1, 逆傅立叶变换 // il: il = 0,不计算傅立叶变换或逆变换模和幅角;il = 1,计算模和幅角 // n: 输入的

    // 入口参数: // l: l = 0, 傅立叶变换 l = 1, 逆傅立叶变换 // il: il = 0,不计算傅立叶变换或逆变换模和幅角;il = 1,计算模和幅角 // n: 输入的点数,为偶数,一般为32,64,128,...,1024等 // k: 满足n=2^k(k>0),实质上k是n个采样数据可以分解为偶次幂和奇次幂的次数 // pr[]: l=0时,存放N点采样数据的实部 // l=1时, 存放傅立叶变换的N个实部 // PI[]: l=0时,存放N点采样数据的虚部 // l=1时, 存放傅立叶变换的N个虚部 // // 出口参数: // fr[]: l=0, 返回傅立叶变换的实部 // l=1, 返回逆傅立叶变换的实部 // fi[]: l=0, 返回傅立叶变换的虚部 // l=1, 返回逆傅立叶变换的虚部 // pr[]: il = 1,i = 0 时,返回傅立叶变换的模 // il = 1,i = 1 时,返回逆傅立叶变换的模 // PI[]: il = 1,i = 0 时,返回傅立叶变换的辐角 // il = 1,i = 1 时,返回逆傅立叶变换的辐角

    标签: il 傅立叶变换 计算

    上传时间: 2017-01-03

    上传用户:ynsnjs