SHARE
TWEET

Untitled

a guest May 19th, 2019 91 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #input
  2.  
  3. x=cellfun("str2double",strsplit(input('' ,'s')));
  4. y=cellfun("str2double",strsplit(input('' ,'s')));
  5. z=cellfun("str2double",strsplit(input('' ,'s')));
  6.  
  7. #vec
  8. v1=y - x;
  9. v2=z - x;
  10. #print("%f %f",v1,v2);
  11. #a.b=|a|.|b|cos(temp)
  12. temp=abs(acosd((dot(v1,v2)/(norm(v1)*norm(v2))))); #rad deg
  13. printf("%f\n",temp);
  14. temp2=cross(v1,v2); #cross
  15. #printf("%f",temp2);
  16. temp3=1/2 *norm(temp2);
  17. printf("%f\n",temp3);
  18. temp2=temp2 ./ temp2(1);
  19. printf("%f %f %f",temp2(1),temp2(2),temp2(3));
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top