Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- #define M_PI 3.14159265358979323846
- int main()
- {
- double b, g, t, p, r;
- b=1.0; // beta = 1.0 (desvio da esfericidade)
- g=0.0; // nucleo prolato gamma = 0º
- for (t=0 ; t<=(M_PI) ; t+=(M_PI/90.0))
- {
- for (p = 0.0; p <= (2.0*M_PI); p+=(M_PI/45.0))
- {
- r = 1.0 + b*sqrt(5.0/(16.0*M_PI))*(cos(g)*(3.0*pow(cos(t),2.0)-1.0)+(sqrt(3.0)/2.0)*sin(g)*pow(sin(t),2.0)*cos(2.0*p));
- double x = r*sin(t)*cos(p);
- double y = r*sin(t)*sin(p);
- double z = r*cos(t);
- printf("%f %f %f\n",x,y,z);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement