Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Nama : M .

hasan fauzi

Nim : 2014 5 2004

#include <stdio.h>
#include <conio.h>
#include <math.h>

int main()
{
int a,b,c,d;
float x1,x2,y1,y2;
float pi;

printf("\n");
printf("\n");
printf("-----------PROGRAM FORWARED------------");
printf("\n");
printf("\n");

while(1)
{

printf("\nMasukkan a1 : ");
scanf("%d",&a);

printf("\nMasukkan a2 : ");
scanf("%d",&b);

printf("\nMasukkan teta1 : ");


scanf("%d",&c);

printf("\nMasukkan teta2 : ");


scanf("%d",&d);

pi=3.14159;

x1 = (a*cos((pi*c)/180));
printf("\nHasil x1 = %.2f", x1);

x2 = (a*cos((pi*c)/180)+b*cos((pi*(c+d))/180));
printf("\nHasil x2 = %.2f", x2);

y1 = (a*sin((pi*c)/180));
printf("\nHasil y1 = %.2f", y1);

}
y2 = (a*sin((pi*c)/180)+b*sin((pi*(c+d))/180));
printf("\nHasil y2 = %.2f", y2);

printf("\nJADI NILAI A = (%.2f),(%.2f)", x1,y1);


printf("\nJADI NILAI B = (%.2f),(%.2f)", x2,y2);

getch();
}
}
#include <stdio.h>
#include <conio.h>
#include <math.h>

int main()
{

int a,b,c,d;
float pi;
float abc2,abs2,abt1,abt2,yx,e,f,g,h,i,j,k,l,m,n;

printf("\n");
printf("\n");
printf("-----------PROGRAM INVERSE------------");
printf("\n");
printf("\n");

while(1)
{

printf("\nMasukkan a1 = ");
scanf("%d",&a);

printf("\nMasukkan a2 = ");
scanf("%d",&b);

printf("\nMasukkan x = ");
scanf("%d",&c);

printf("\nMasukkan y = ");
scanf("%d",&d);

pi=3.14159;
e=pow(c,2);
f=pow(d,2);
g=pow(a,2);
h=pow(b,2);
i=(((e+f)-g)-h);
j=(2*a*b);
yx=(float)d/c; //pembagian y/x

abc2 = i/j;
printf("\nHasil cos teta2 = %f",abc2);

abs2 = sqrt(1-(abc2*abc2));
printf("\nHasil sin teta2 = %f", abs2);

abt1 = (atan(yx)*180/pi)-(atan((b*abs2)/(a+(b*abc2)))*180/pi);
printf("\nHasil teta1 = %f", abt1);

abt2 = (atan(abs2/abc2)*180/pi);
printf("\nHasil teta2 = %f", abt2);

getch();
}
}

You might also like