int W[12]={6, 2, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4};
int y, m, d, w;
scanf("%d %d %d",&y, &m, &d);
w=W[m-1]+y+(y/4)-(y/100)+(y/400);
if( ((y%4)==0) && (m<3) ) {
w--;
if((y%100)==0) w++;
if((y%400)==0) w--;
}
printf("%d\n", (w+d)%7);
A collection useful programming advice the author has collected over the years; small algorithms that make the programmer's task easier.
more fromwww.hackersdelight.org
如果重新取樣時,取樣點的間距比原來要大,即縮小圖形的時候,就會出現新的問題。最明顯的問題,在於取樣點間距放大時,相對的,取樣頻率也就減少了。這時,訊號中就可能會包含一些過高的頻率成份。所以,這時候會需要一個 low pass filter。
more fromwww.csie.ntu.edu.tw
A line drawing algorithm is a graphical algorithm for approximating a line segment on discrete graphical media. On discrete media, such as pixel-based displays and printers, line drawing requires such an approximation (in nontrivial cases).
more fromen.wikipedia.org
All the basic graphics programs goes here
In computer graphics, the midpoint circle algorithm is an algorithm used to determine the points needed for drawing a circle. The algorithm is a variant of Bresenham's line algorithm, although not invented by Bresenham. The algorithm is therefore also sometimes referred to as Bresenham's circle algorithm.
more fromen.wikipedia.org
The Bresenham line algorithm is an algorithm that determines which points in an n-dimensional raster should be plotted in order to form a close approximation to a straight line between two given points. It is commonly used to draw lines on a computer screen, as it uses only integer addition, subtraction and bit shifting all of which are very cheap operations in standard computer architectures. It is one of the earliest algorithms developed in the field of computer graphics.
more fromen.wikipedia.org
more fromwww.bookzone.com.tw
more fromblog.linux.org.tw
more fromwww.roboticfan.com
Notation: * = Private bookmark and comment|… = Clipping [?] | … = Public highlight [?]