Attachment 't01.c'

Download

   1 // t01.c
   2 // v0.1 KHL 2009-04-21
   3 // gcc -o t01 t01.c -lm -lgd ; ./t01
   4 // static drawing, though slow to compute
   5 // earth and toroid around orbit
   6 
   7 #define TITLE    "M288, 1 center orbit"
   8 #define GIFOUT   "t01.gif"
   9 #define DELTANG 0.2
  10 #define ORBWIDTH  9
  11 #define ANG0      0
  12 #define ANG1     90
  13 #define ANG2    142
  14 #define NELIP    32
  15 
  16 #include "tor00.hc"
  17 
  18 int main () {
  19    double  t_ang ;
  20    int     e_cnt ;
  21    int     orb ;
  22    int     norb ;
  23  
  24    gdPoint ellipse[NELIP+2];
  25 
  26    displaystart();
  27    torstart();
  28 
  29    gdImageGifAnimBegin( im1, gifout, 1, -1 ) ; // no repeat
  30    // gdImageGifAnimBegin( im1, gifout, 1,  4 ) ; // repeat 4 times
  31    // gdImageGifAnimBegin( im1, gifout, 1,  0 ) ; // continuous repeat
  32 
  33    framestart(    90, TITLE );
  34 
  35    for( t_ang=-ANG1 ; t_ang < ANG1 ; t_ang += DELTANG ) {
  36       double  angle_rad=DEG2RAD( t_ang );
  37       double  tox = -major*sin( angle_rad );
  38       double  toz = -major*cos( angle_rad );
  39       gdPoint pto = sr0( tox, 0.0, toz );
  40       gdImageFilledEllipse( im, pto.x, pto.y, ORBWIDTH, ORBWIDTH, tc[0]);
  41    }
  42    drawearth();
  43 
  44    for( t_ang=ANG1 ; t_ang < 360-ANG1 ; t_ang += DELTANG ) {
  45       double  angle_rad=DEG2RAD( t_ang );
  46       double  tox = -major*sin( angle_rad );
  47       double  toz = -major*cos( angle_rad );
  48       gdPoint pto = sr0( tox, 0.0, toz );
  49       gdImageFilledEllipse( im, pto.x, pto.y, ORBWIDTH, ORBWIDTH, tc[0]);
  50    }
  51 
  52    frameend();
  53    displayend();
  54    return 0;
  55 }

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2009-05-12 03:45:56, 11.6 KB) [[attachment:ap01.c]]
  • [get | view] (2009-05-12 20:57:15, 11.1 KB) [[attachment:ap02.c]]
  • [get | view] (2021-06-19 05:05:20, 853.5 KB) [[attachment:ap02.png]]
  • [get | view] (2009-05-11 08:39:41, 1.4 KB) [[attachment:t01.c]]
  • [get | view] (2009-05-11 02:49:58, 14.3 KB) [[attachment:t01.gif]]
  • [get | view] (2009-05-11 08:39:31, 4.0 KB) [[attachment:t04.c]]
  • [get | view] (2009-05-11 02:50:13, 24.3 KB) [[attachment:t04.gif]]
  • [get | view] (2009-05-11 08:39:10, 4.0 KB) [[attachment:t08.c]]
  • [get | view] (2009-05-11 02:50:25, 29.6 KB) [[attachment:t08.gif]]
  • [get | view] (2009-05-11 02:53:25, 34.8 KB) [[attachment:t12.gif]]
  • [get | view] (2009-05-11 08:38:55, 4.0 KB) [[attachment:t16.c]]
  • [get | view] (2009-05-11 02:53:12, 38.0 KB) [[attachment:t16.gif]]
  • [get | view] (2009-05-11 08:38:44, 4.0 KB) [[attachment:t20.c]]
  • [get | view] (2009-05-11 02:52:57, 39.6 KB) [[attachment:t20.gif]]
  • [get | view] (2009-05-11 08:38:32, 4.0 KB) [[attachment:t24.c]]
  • [get | view] (2009-05-11 02:52:39, 44.0 KB) [[attachment:t24.gif]]
  • [get | view] (2009-05-11 08:37:48, 4.0 KB) [[attachment:t25.c]]
  • [get | view] (2009-05-11 02:52:29, 41.5 KB) [[attachment:t25.gif]]
  • [get | view] (2009-05-11 08:38:21, 3.4 KB) [[attachment:t26.c]]
  • [get | view] (2009-05-11 02:52:12, 28.0 KB) [[attachment:t26.gif]]
  • [get | view] (2009-05-11 08:37:25, 2.5 KB) [[attachment:t27.c]]
  • [get | view] (2009-05-11 02:51:59, 25.8 KB) [[attachment:t27.gif]]
  • [get | view] (2009-05-11 08:37:13, 2.5 KB) [[attachment:t28.c]]
  • [get | view] (2009-05-11 02:51:34, 18.5 KB) [[attachment:t28.gif]]
  • [get | view] (2009-05-11 08:37:01, 1.4 KB) [[attachment:t41.c]]
  • [get | view] (2009-05-11 02:51:19, 11.4 KB) [[attachment:t41.gif]]
  • [get | view] (2009-05-11 08:36:46, 3.6 KB) [[attachment:t42.c]]
  • [get | view] (2009-05-11 02:50:49, 5.3 KB) [[attachment:t42.gif]]
  • [get | view] (2009-05-11 08:36:31, 13.4 KB) [[attachment:tor00.hc]]
 All files | Selected Files: delete move to page

You are not allowed to attach a file to this page.