Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dd1994
Created November 24, 2013 08:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dd1994/7624808 to your computer and use it in GitHub Desktop.
Save dd1994/7624808 to your computer and use it in GitHub Desktop.
物理實驗報告“波爾共振”的一個麻煩算數題 -std=c99
#include <stdio.h>
#include <math.h>
double f(double,double);
int main(void)
{
double t0[10] = {1.558, 1.560, 1.563, 1.565, 1.566, 1.565, 1.565, 1.563, 1.561, 1.559};
double t[10] = {1.568, 1.569, 1.571, 1.573, 1.576, 1.582, 1.584, 1.587, 1.590, 1.595};
for (int i = 0; i < 10; ++i)
{
printf("%.3f\n",f(t0[i], t[i])*180/3.1415926 );
}
printf("\n\n\n");
for (int i = 0; i < 10; ++i)
{
printf("%.3f\n", t0[i]/t[i]);
}
}
double f(double a,double b)
{
double c;
c = atan((0.05956*a*a*b)/(3.1415926*(b*b - a*a)));
return c;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment