Location:
Search - radius pi
Search list
Description: (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,并重新运行,验证是否运行正确。
Platform: |
Size: 5281 |
Author: fangfei |
Hits:
Description: C++完美演绎 经典算法 如 /* 头文件:my_Include.h */ #include <stdio.h> /* 展开C语言的内建函数指令 */ #define PI 3.1415926 /* 宏常量,在稍后章节再详解 */ #define circle(radius) (PI*radius*radius) /* 宏函数,圆的面积 */ /* 将比较数值大小的函数写在自编include文件内 */ int show_big_or_small (int a,int b,int c) { int tmp if (a>b) { tmp = a a = b b = tmp } if (b>c) { tmp = b b = c c = tmp } if (a>b) { tmp = a a = b b = tmp } printf(\"由小至大排序之后的结果:%d %d %d\\n\", a, b, c) } 程序执行结果: 由小至大排序之后的结果:1 2 3 可将内建函数的include文件展开在自编的include文件中 圆圈的面积是=201.0619264-C perfect interpretation of classic algorithms / * header files : my_Include.h * / # include lt; Stdio.hgt; / * Start with the built-in C language function instructions * / # define PI 3.1415926 / * Acer constants later, in another chapter Elaborates on * / # define circle (radius) (PI * * radius radius) / * Macro function, a round of the area * / / * to compare the numerical size of the write functions include writing paper * / int show_big_or_small (int a, b int, int c) (int tmp if (Agt; b) (tmp = a b a = b = tmp) if (BGT; c) (tmp = b b = c c = tmp) if (Agt; b) ( tmp = a b a = b = tmp) printf ( "ascending order by the following results :% d% d% d \\ n", a, b, c)) procedures : in ascending order by the following results : 1 2 3 will the built-in functions include documents writte
Platform: |
Size: 130555 |
Author: 立功 |
Hits:
Description: C++完美演绎 经典算法 如 /* 头文件:my_Include.h */ #include <stdio.h> /* 展开C语言的内建函数指令 */ #define PI 3.1415926 /* 宏常量,在稍后章节再详解 */ #define circle(radius) (PI*radius*radius) /* 宏函数,圆的面积 */ /* 将比较数值大小的函数写在自编include文件内 */ int show_big_or_small (int a,int b,int c) { int tmp if (a>b) { tmp = a a = b b = tmp } if (b>c) { tmp = b b = c c = tmp } if (a>b) { tmp = a a = b b = tmp } printf("由小至大排序之后的结果:%d %d %d\n", a, b, c) } 程序执行结果: 由小至大排序之后的结果:1 2 3 可将内建函数的include文件展开在自编的include文件中 圆圈的面积是=201.0619264-C perfect interpretation of classic algorithms/* header files : my_Include.h* /# include lt; Stdio.hgt;/* Start with the built-in C language function instructions* /# define PI 3.1415926/* Acer constants later, in another chapter Elaborates on* /# define circle (radius) (PI** radius radius)/* Macro function, a round of the area*//* to compare the numerical size of the write functions include writing paper*/int show_big_or_small (int a, b int, int c) (int tmp if (Agt; b) (tmp = a b a = b = tmp) if (BGT; c) (tmp = b b = c c = tmp) if (Agt; b) ( tmp = a b a = b = tmp) printf ( "ascending order by the following results :% d% d% d \ n", a, b, c)) procedures : in ascending order by the following results : 1 2 3 will the built-in functions include documents writte
Platform: |
Size: 130048 |
Author: 立功 |
Hits:
Description: %radon transform
clear all
%
N=800
n=1:N
fs=200
t=n/fs
x1=exp(j*2*pi*(5*t+0.5*5*t.^2))
x2=exp(j*2*pi*(5*t+0.5*15*t.^2))
x=x1+x2
%N=length(x)
% ambifunb(x )
%*****************************************RAT
naf=ambifunb(x)
htl(abs(naf))
% [wh,rho,theta]=htl(abs(naf))
colormap([0,0,0])
% xlabel( 极半径 )
% ylabel( 角度 )
%**************************************%找出峰值点的坐标,计算初始频率和调频斜率(正确)
%找出峰值点的坐标
b=max(max(wh))
[u,a]=find(wh>=0.8*b)
- Radon transformclear all N = 800 n = 1: N fs = 200 t = n/fs x1 = exp (j* 2* pi* (5* t+ 0.5* 5* t. ^ 2)) x2 = exp ( j* 2* pi* (5* t+ 0.5* 15* t. ^ 2)) x = x1+ x2 N = length (x) ambifunb (x)***************************************** RATnaf = ambifunb (x) htl (abs (naf)) [wh, rho, theta ] = htl (abs (naf)) colormap ([0,0,0]) xlabel (polar radius) ylabel (angle)************************************** to find the coordinates of the peak point, calculating the initial slope of the frequency and FM (right) find the peak point of the coordinates b = max (max ( wh)) [u, a] = find (wh
Platform: |
Size: 1024 |
Author: abcde |
Hits:
Description: (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,并重新运行,验证是否运行正确。
Platform: |
Size: 5120 |
Author: fangfei |
Hits:
Description: 通过输入圆的半径,经过计算得出圆的面积(pi=3.1415)-By entering the circle radius, the calculated area of a circle (pi = 3.1415)
Platform: |
Size: 131072 |
Author: zhaomei |
Hits:
Description: 圆周率计算程序,这个程序可输入半径后求得周长。-Pi calculation program can be obtained after the input radius of the perimeter.
Platform: |
Size: 45056 |
Author: tspp |
Hits:
Description: radius ping 工具,可供调试,使用简捷-radius ping
Platform: |
Size: 64512 |
Author: lm |
Hits:
Description: 题意:已知一个圆的弦长l0及这条弦所在的弧长l1,求弦的中心点到弧的中心点的距离
思想:这是一个列方程然后利用二分法解方程的题目,令该疑弧所对的圆心角为anlg,
半径为r,根据题意有两个方程:l1=anlg*r l0=2*r*sin(anlg/2) 两个方程两个未知数,
通过化简有:2*l1*sin(anlg/2)-anlg*l0=0 因为角度的值是从0到2*pi,题目中讲到过
弧的长度不可能大于弦的两倍,所以角度不可能取到2*pi,但是有可能为0,把零特殊考虑,
再从0到2*pi间二分找解就不会出错了!但是要注意精度问题,取七位小数才能得出正确解.-Italian title: Known l0 chord of a circle and arc length of this string where l1, seeking the center of the arc chord distance of the center of thought: This is a solution out equations and then use the dichotomy of the title equation, so that The arc of the doubt on the central angle for the anlg, radius r, according to the meaning of problems with two equations: l1 = anlg* r l0 = 2* r* sin (anlg/2) two equations two unknowns, by simplification are: 2* l1* sin (anlg/2)-anlg* l0 = 0 because the value of the angle is from 0 to 2* pi, the title referred to had not greater than the arc length of the string twice, So can not get to the point of 2* pi, but there may be 0, to zero special consideration, and then from 0 to 2* pi to find solution between the two points will not be wrong! but to pay attention to accuracy problems, were taken to seven decimal the correct solution.
Platform: |
Size: 1024 |
Author: yangxiuyi |
Hits:
Description: 实验3类、对象以及包的使用(6学时)
1.实验内容
(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对象,并调用相关方法,输出方法的返回值,验证其正确性。
-Experiment 3 classes, objects, and use the package (6 hours) 1. Experimental content (1) implement a Point class that contains the coordinates of the two int variables x, y, constructor Point () and Point (int xx , int yy), return x and y values int getX () and int getY () method to calculate the distance between two points of the double distance (Point) method. Which calculate the square root with Math.sqrt () method.
Platform: |
Size: 1024 |
Author: duanduan |
Hits:
Description: 问题描述
给定圆的半径r,求圆的面积。
输入格式
输入包含一个整数r,表示圆的半径。
输出格式
输出一行,包含一个实数,四舍五入保留小数点后7位,表示圆的面积。
说明:在本题中,输入是一个整数,但是输出是一个实数。
对于实数输出的问题,请一定看清楚实数输出的要求,比如本题中要求保留小数点后7位,则你的程序必须严格的输出7位小数,输出过多或者过少的小数位数都是不行的,都会被认为错误。
实数输出的问题如果没有特别说明,舍入都是按四舍五入进行。
样例输入
4
样例输出
50.2654825
数据规模与约定
1 <= r <= 10000。
提示
本题对精度要求较高,请注意π的值应该取较精确的值。你可以使用常量来表示π,比如PI=3.14159265358979323,也可以使用数学公式来求π,比如PI=atan(1.0)*4。-Problem description
A given circle radius r, and the area of a circle.
Input format
Input contains an integer r, said the radius of the circle.
The output format
Output a line contains a real number, rounded after the decimal point 7, said the area of a circle.
Note: in the ontology, the input is an integer, but the output is a real number.
Answer to the question of the real output please see real output requirements, such as the subject of seven after decimal point, is the output of your application must be strictly 7 decimal places, the output of decimal digits too little or too much is not enough, will be considered.
The problem of real output if there are no special instructions, rounding is each round.
The sample input
4
Sample output
50.2654825
The data scale and conventions
1 < = r < = 10000.
prompt
Subject to the precision demand is higher, please pay attention to the value of PI should take more accurate values. You can use a constant to represent the PI
Platform: |
Size: 9216 |
Author: 童话Bu说话 |
Hits:
Description: theta_k = pi/2/G + (1:G)*pi/G [1 60]
h =0.2 discarding the less reliable data points
index = find(radius>=h) [1 50]
radius = radius(index) [1 50]
theta = theta(index) [1 50]-theta_k = pi/2/G+ (1:G)*pi/G [1 60]
h =0.2 discarding the less reliable data points
index = find(radius>=h) [1 50]
radius = radius(index) [1 50]
theta = theta(index) [1 50]
Platform: |
Size: 2048 |
Author: peiguangzhong |
Hits:
Description: 7月17日是Mr.W的生日,ACM-THU为此要制作一个体积为N*pi的M层生日蛋糕,每层都是一个圆柱体。
设从下往上数第i(1 <= i <= M)层蛋糕是半径为Ri, 高度为Hi的圆柱。当i < M时,要求Ri > Ri+1且Hi > Hi+1。
由于要在蛋糕上抹奶油,为尽可能节约经费,我们希望蛋糕外表面(最下一层的下底面除外)的面积Q最小。
令Q = S*pi
请编程对给出的N和M,找出蛋糕的制作方案(适当的Ri和Hi的值),使S最小-July 17 is the birthday of Mr.W, ACM-THU do this want to make a volume of N* pi M-layer birthday cake, each layer is a cylinder.
Set number the bottom section i (1 <= i <= M) layer cake with a radius Ri, a cylindrical height of Hi. When i <M, the requirement Ri> Ri+ 1 and Hi> Hi+ 1.
Due to the cake rubbed cream, as much as possible to save funds, we hope the outer surface of the cake (the lowest layer of the underside of the exception) Q smallest area.
So that Q = S* pi
Please programming given N and M, find the cake production program (the appropriate value of Ri and Hi), the S minimum
Platform: |
Size: 6144 |
Author: wxs |
Hits:
Description: 取圆周率为3.1415926,分别输入半径为40和928.335,求圆面积,要求各数据按域宽10位输出,先输出圆周率和半径,再输出其面积-3.1415926 circumference was taken, and receives a radius of 40 and 928.335, of circular area, requiring the data output by the field width 10, the first output pi and the radius, and then output the area
Platform: |
Size: 531456 |
Author: 罗陈 |
Hits: