High school time to do, the first two days to see, quite fun.
/***0-360 cosine function Image ***/# include < stdio.h ># include < math.h >int main ( void ) { double y; int m, i; for ( y = 1; y >= -1; y -= 0.1 ) { m = acos (y) * 10; for ( i = 1 ; i < m; i++ ) { printf (" "); } printf ("*"); for ( ; i < 62 - m; i++ ) { printf (" ") } printf ("*\n"); } return 0;} Second way/*** cosine function image ***/#include <stdio.h> #include <math.h>int main (void) {double m, x, y; for (&NBSP;Y&NBSP;=&NBSP;1;&NBSP;Y&NBSP;>=&NBsp;-1; y -= 0.1) { m = acos (y); for ( x = 0; x < m; x += 0.1) putchar (' '); putchar (' * '); for (; x < 6.2 - m; x += 0.1) putchar (' '); putchar (' * '); putchar (' \ n ');} return 0;}
After running
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6C/21/wKiom1VAeUHCdbJpAAECbUHgYSo335.jpg "title=" 1.jpg " alt= "Wkiom1vaeuhcdbjpaaecbuhgyso335.jpg"/>
This article is from the "hacker" blog, make sure to keep this source http://anglecode.blog.51cto.com/5628271/1640305
The chord function cos of interesting graphs