Thursday, June 2, 2011

TO FIND ANGULAR MOMENTUM OF A ROTATING BODY

0 comments
#include<stdio.h>
#include<stdio.h>
#include<stdio.h>
void main()
{
int a1,a2,a3,p1,p2,p3,l1,l2,l3;
printf("Enter the componetns of distance from axis of rotation");
scanf("%d%d%d",&a1,&a2,&a3);
Printf("\nEnter the components of linear momentum");
scanf("%d%d%d",&p1,&p2,&p3);
l1=a2*p3-a3*p2;
l2=a3*p1-a1*p3;
l3=a1*p2-p1*a2;
printf("The angular momentum vector is given by %di+%dj+%dk",l1,l2,l3);
getch();
}






Algorith:


1.Start
2.Read component of distance from axis of rotation a1,a2,a3
3.Read the components of angular momentum p1,p2,p3
4.calculate
 l1=a2*p3-a3*p2;
l2=a3*p1-a1*p3;
l3=a1*p2-p1*a2;
5.Print the angular momentum l1i+l2j+l3k
6.Stop




Leave a Reply