C language to calculate the total area and radius of the International 75 ellipsoid

C language to calculate the total area and radius of the International 75 ellipsoid

1. Run the code to get the area of ​​the ellipsoid.

The total area of ​​the International 75 ellipsoid is: 510066100693931.625000 square meters (510661 million square kilometers)
the radius of the earth's sphere Re=6371010.172219 meters
Insert picture description here

2. Part of the source code

#include<stdio.h>
#include<math.h>
#define guoji75_a 6378140.00
#define guoji75_b 6356755.2881575287
#define PI 3.1415926535897932
#define keshi_a 6378245.0
#define keshi_b 6356863.0187730473

double guoji75quanmianji()
{
	double P,L1,L2,B1,B2,a,b,e1;
	L1 = 0.0;
	L2 = PI;
	B1 = 0.0;
	B2 = PI/2;
	a = guoji75_a;
	b = guoji75_b;
	e1 = (sqrt((a * a) - (b * b))) / a;
	P=b*b*(L2-L1)*(((sin(B2)/(1-(e1*e1*sin(B2)*sin(B2))))+((1/(2*e1))*log((1+e1*sin(B2))/(1-e1*sin(B2)))))-((sin(B1)/(1-(e1*e1*sin(B1)*sin(B1))))+((1/(2*e1))*log((1+e1*sin(B1))/(1-e1*sin(B1))))));	
	return P;
}


main()
{
	double a, e1,e2,M,N,R,_a,_b,A,B,X,P,x1,x2;
	int weidu[3],fangweijiao[3],L1[3],L2[3],B1[3],B2[3],weidu1[3],weidu2[3];
	int i,fg;

	printf("下面计算国际75椭球全面积和与地球椭球面积相等的地球圆球的半径Re\n");
	P=guoji75quanmianji();
	printf("国际75椭球全面积为:%f平方米(%f亿平方公里)\n",2*P,2*P/100000000000000);
	printf("地球圆球半径Re=%f米\n",sqrt(P/2/PI));
	scanf_s("%d",&fg);
}

Guess you like

Origin blog.csdn.net/peter_young1990/article/details/114803304