--> //initializations

--> c=6 //KN/m^2 (cohession)
 c  = 

   6.


--> x=20 //(angle of shear resistance)
 x  = 

   20.


--> Y=17 //KN/m^3 (unit weight)
 Y  = 

   17.


--> y=25 //(angle at A)
 y  = 

   25.


--> z=45 //(angle at C)
 z  = 

   45.


--> d1=1.5 //m (distance between A to C)
 d1  = 

   1.5


--> d2=2.5 //m (distance between A to D)
 d2  = 

   2.5


--> b1=2.86 //m (distance between D to B)
 b1  = 

   2.86


--> b2=5.36 //m (distance between A to B horizontal)
 b2  = 

   5.36


--> //calculations

--> W=(b1*d2*Y)/2 //(weight of triangle wedge ABD) 
 W  = 

   60.775


--> T=W*sinm((y*%pi)/180) //(sliding force)
 T  = 

   25.684625


--> L=d2/sinm((y*%pi)/180) //(length of plane AB)
 L  = 

   5.915504


--> S=(c*L)+(W*cosd(y)*tanm((x*%pi)/180)) //(Resistance to sliding)
 S  = 

   55.540816


--> Fs=S/T //(factor of safety)
 Fs  = 

   2.1624149


--> //results

--> printf('factor of safety=%f',Fs)
factor of safety=2.162415
