#include#includedouble f1(float a,float b){ int i;double result,h,l; double sum=0;l=(a-b)/1000;for(i=0;i<1000;i++){ h=sin(b+l*i)+sin(b+l*(i++)); resul...
分类:
其他好文 时间:
2014-12-26 18:35:18
阅读次数:
181
像360卫士的波浪球进度的效果,一般最常用的方法就是 画线的方式,先绘sin线或贝塞尔曲线,然后从左到右绘制竖线,然后再裁剪圆区域。今天我这用图片bitmap的方式,大概的方法原理是:(1)首先用clipPath裁剪园区域,(2)然后用4张图来不断绘制到画布上,再用偏移量来控制移动的速度,从而形成波...
分类:
移动开发 时间:
2014-12-25 18:16:44
阅读次数:
200
1. matlab命令基础:
clc——清除窗口
clear——清除之前赋值过的变量
disp——打印信息,相当于echo
celldisp——打印元胞数组内容
who——简单的显示当前已有变量
whos——显示所有变量及详细内容 whos也可以指定显示某个变量
tan/sin/cos/log ——各种数学运算...
分类:
其他好文 时间:
2014-12-25 16:22:55
阅读次数:
370
3. 计算下列不定积分(3)\[ \int \sin^2 x \tan x \sec x dx= \int \sin^2 x d (\sec x) =\int (1-\frac{1}{\sec^2 x}) d(\sec x)=\sec x +\frac{1}{\sec x}+C.\]注意到常用的凑微...
分类:
其他好文 时间:
2014-12-23 23:56:33
阅读次数:
167
首先要建立服务器建立起socket,然后与本地的端口进行绑定,接着就开始接收客户端的请求并建立与它的连接,接下来,客户端发送的消息。
tcpserver.c代码:
int main()
{
struct sockaddr_in server_sockaddr,client_sockaddr;
int sin_size,recvbytes;
int sockfd, client_fd;
...
分类:
系统相关 时间:
2014-12-22 16:15:51
阅读次数:
283
pcf.minputSamp = (0:0.1:1)';result = sin(2*pi*inputSamp);gsNoise = randn(11,1)*0.1;observation = result + gsNoise;x=(0:0.01:1)';y=sin(2*pi*x);%{figure...
分类:
其他好文 时间:
2014-12-20 19:35:23
阅读次数:
268
Help Me Escape
Time Limit: 2 Seconds
Memory Limit: 32768 KB
Background
If thou doest well, shalt thou not be accepted? and if thou doest not well, sin lieth at the door. And unto th...
分类:
其他好文 时间:
2014-12-20 16:56:16
阅读次数:
207
题目大意:有一个直角拐角,给你水平道路宽度Y和竖直高度X,再给你汽车的长l,宽w
问:汽车是否能通过这个拐角。
思路:如果汽车的宽度大于水平道路宽度Y或是竖直高度X,无论如何都通不过。接下来
考虑一般情况。
如图:若汽车最左边与墙一直靠紧,则只需要判断右边最高点是否超过了Y。
设θ为汽车与水平方向的夹角,s为汽车最右边的角到拐点的水平距离。那么
s = l*cos(θ) + w*sin(θ) - x,从而得出 h = s*tan(θ)+w*cos(θ)。
θ角从0~π/2,变化,h则从低到高再到底,且是一个...
分类:
其他好文 时间:
2014-12-17 09:48:36
阅读次数:
243
?
function drawImg(angle)
{
canvas.width = canvas.width;
var distance = size / 2 * Math.sqrt(2) * Math.sin(angle * Math.PI / 180 / 2) * 2;
var degree = 180 - 45 - (180 - angle) / 2;
...
分类:
编程语言 时间:
2014-12-15 17:25:26
阅读次数:
208
题意:在给定的高度和初速度,任意抛使得它水平距离最远。题解:我们可以很容易的推出length = v*cos(x)*( sqrt( 2.0*h*g + v*v*sin(x)*sin(x) ) + v*sin(x) ) / g; 然后对 [ 0, π/2 ] 之间的弧度三分查找(凸线图形一般用三分) ...
分类:
其他好文 时间:
2014-12-14 22:37:58
阅读次数:
205