Advertisement
ahmad_zizo

LOAY

Jan 8th, 2015
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 1.85 KB | None | 0 0
  1. %cosdtheta4
  2. if(mod(acosd((((r3*cosd(theta3))-(d*cosd(thetad)))/r4)),360)>= 0 & mod(acosd((((r3*cosd(theta3))-(d*cosd(thetad)))/r4)),360) <= 90) %1st
  3.     cosdtheta4=abs(acosd(((r3*cosd(theta3))-(d*cosd(thetad)))/r4))
  4. elseif(mod(acosd((((r3*cosd(theta3))-(d*cosd(thetad)))/r4)),360) > 90 & mod(acosd((((r3*cosd(theta3))-(d*cosd(thetad)))/r4)),360) <= 180)  %2nd
  5.     cosdtheta4=180 - abs(acosd(((r3*cosd(theta3))-(d*cosd(thetad)))/r4))
  6. elseif(mod(acosd((((r3*cosd(theta3))-(d*cosd(thetad)))/r4)),360) > 180 & mod(acosd((((r3*cosd(theta3))-(d*cosd(thetad)))/r4)),360) <= 270)  %3d
  7.     cosdtheta4=180 + abs(acosd(((r3*cosd(theta3))-(d*cosd(thetad)))/r4))
  8. elseif(mod(acosd((((r3*cosd(theta3))-(d*cosd(thetad)))/r4)),360) > 270 & mod(acosd((((r3*cosd(theta3))-(d*cosd(thetad)))/r4)),360) <360)  %4th
  9.     cosdtheta4=360 - abs(acosd(((r3*cosd(theta3))-(d*cosd(thetad)))/r4))
  10. end  
  11. %cosdtheta4=acosd(((r3*cosd(theta3))-(d*cosd(thetad)))/r4)
  12. %sindtheta4
  13.  
  14. if(mod(asind((((r3*sind(theta3))-(d*sind(thetad)))/r4)),360)>= 0 & mod(asind((((r3*sind(theta3))-(d*sind(thetad)))/r4)),360) <= 90) %1st
  15.     sindtheta4= abs(asind(((r3*sind(theta3))-(d*sind(thetad)))/r4))
  16. elseif(mod(asind((((r3*sind(theta3))-(d*sind(thetad)))/r4)),360) > 90 & mod(asind((((r3*sind(theta3))-(d*sind(thetad)))/r4)),360) <= 180)  %2nd
  17.     sindtheta4= 180 - abs(asind(((r3*sind(theta3))-(d*sind(thetad)))/r4))
  18. elseif(mod(asind((((r3*sind(theta3))-(d*sind(thetad)))/r4)),360) > 180 & mod(asind((((r3*sind(theta3))-(d*sind(thetad)))/r4)),360) <= 270)  %3d
  19.     sindtheta4= 180 + abs(asind(((r3*sind(theta3))-(d*sind(thetad)))/r4))
  20. elseif(mod(asind((((r3*sind(theta3))-(d*sind(thetad)))/r4)),360) > 270 & mod(asind((((r3*sind(theta3))-(d*sind(thetad)))/r4)),360) <360)  %4th
  21.     sindtheta4=360 - abs(asind(((r3*sind(theta3))-(d*sind(thetad)))/r4))
  22. end  
  23. %sindtheta4=asind(((r3*sind(theta3))-(d*sind(thetad)))/r4)
  24.  
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement