File:Varipend3v16.png

From TORI
Jump to: navigation, search
Original file(8,334 × 1,384 pixels, file size: 592 KB, MIME type: image/png)

Coordinates of the 4 elementary bodies for the Varipend by Sergei Butov.

Masses of bodies: $m_0\!=\!1$, $m_1\!=\!1$, $m_2\!=\!1$, $m_3\!=\!10$

At time $t\!=\!0$, the 0th body is released and flies away to the positive x-direction. The rest continues to rotate with the same angular velocity and slowly (as it is heavy) moves to the opposite direction.

Coordinates $X_n$ are plotted versus time with thick light lines; red, green, blue, pink. Coordinates $Y_n$ are plotted versus time with thin dark lines of similar colors.

The center of mass remains at the origin of coordinates. The total momentum also remains zero.

Generator of curves

FIle ado.cin should be loaded to the working directory in order to compile the code below:

#include <math.h>
#include <stdio.h>
#include<stdlib.h>
#include "ado.cin"
#define DB double
DB q=1./sqrt(3.);
DB f=M_PI*2./3.;
DB s=q/12.;

DB x1= .5;  DB z1=q/2. -s;
DB x2=-.5;  DB z2=q/2. -s;
DB x3= 0.;  DB z3=     -s;
DB X0(DB t){if(t<0) return  q*sin(t);   return  q*t; } 
DB Y0(DB t){if(t<0) return -q*cos(t);   return -q;} 
DB X1(DB t){if(t<0) return  q*sin(t+  f); return -s*t+x1*cos(t)-z1*sin(t);}
DB Y1(DB t){if(t<0) return -q*cos(t+  f); return  s  +x1*sin(t)+z1*cos(t);}
DB X2(DB t){if(t<0) return  q*sin(t+2*f); return -s*t+x2*cos(t)-z2*sin(t);}
DB Y2(DB t){if(t<0) return -q*cos(t+2*f); return  s  +x2*sin(t)+z2*cos(t);}
DB X3(DB t){if(t<0) return 0.;           return -s*t + x3*cos(t)-z3*sin(t);}
DB Y3(DB t){if(t<0) return 0.;           return  s   + x3*sin(t)+z3*cos(t);}
#define DO(x,y) for(x=0;x<y;x++)
main(){ int n; DB t, a,b;
FILE *o; o=fopen("16.eps","w"); ado(o,4000,664);
#define M(x,y) fprintf(o,"%6.4f %6.4f M\n",0.+x,0.+y);
#define L(x,y) fprintf(o,"%6.4f %6.4f L\n",0.+x,0.+y);
fprintf(o,"1000 190 translate 100 100 scale\n");
M(-10,0)L(30,0) M(0,-.9)L(0,0.9) fprintf(o,"0 0 0 RGB 0.005 W S\n");
fprintf(o,"1 setlinejoin 1 setlinecap\n");
DO(n,200){t=-10.+.1*n; a=X0(t); if(n==0)M(t,a) else L(t,a)} fprintf(o,"0.04 W 1 0 0 RGB S\n");
DO(n,402){t=-10.+.1*n; a=Y0(t); if(n==0)M(t,a) else L(t,a)} fprintf(o,"0.016 W .5 0 0 RGB S\n"); 
DO(n,402){t=-10.+.1*n; a=X1(t); if(n==0)M(t,a) else L(t,a)} fprintf(o,"0.04 W 0 .9 0 RGB S\n");
DO(n,402){t=-10.+.1*n; a=Y1(t); if(n==0)M(t,a) else L(t,a)} fprintf(o,"0.016 W 0 .5 0 RGB S\n");
DO(n,402){t=-10.+.1*n; a=X2(t); if(n==0)M(t,a) else L(t,a)} fprintf(o,"0.04 W 0 0 1 RGB S\n");
DO(n,402){t=-10.+.1*n; a=Y2(t); if(n==0)M(t,a) else L(t,a)} fprintf(o,"0.016 W 0 0 .5 RGB S\n");
DO(n,402){t=-10.+.1*n; a=X3(t); if(n==0)M(t,a) else L(t,a)} fprintf(o,"0.04 W .8 0 .8 RGB S\n");
DO(n,402){t=-10.+.1*n; a=Y3(t); if(n==0)M(t,a) else L(t,a)} fprintf(o,"0.016 W .4 0 .4 RGB S\n");
fprintf(o,"showpage\n"); fprintf(o,"%c%cTrailer\n",'%','%'); fclose(o);
system("epstopdf 16.eps");
system(    "open 16.pdf");
}

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current17:50, 20 June 2013Thumbnail for version as of 17:50, 20 June 20138,334 × 1,384 (592 KB)Maintenance script (talk | contribs)Importing image file
  • You cannot overwrite this file.

There are no pages that link to this file.

Metadata