Facebook
From Little Bushbaby, 6 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 251
  1. function skrypt(a,b,c)
  2. A = sort([a b c]);
  3. a = A(1); b = A(2); c = A(3);
  4. if(a+b<c)
  5.         disp(' nie istnieje');
  6.         return
  7. end
  8. if(a==c)
  9.         disp('trojkat rownoboczny');
  10.         return
  11. end
  12. if(a==b || b==c)
  13.         disp('trojkat rownoramienny');
  14. end
  15.  
  16. x = (a^2+b^2-c^2)/(2*a)
  17. y = sqrt((2*a*b^2-a^2-b^2+c^2)/(2*a))
  18. line([0 a],[0 0], 'Color' , 'black')
  19. line([x 0],[y 0], 'Color' , 'red')
  20. line([x a],[y 0], 'Color' , 'green')
  21. end
  22. function test()
  23.  
  24. end
  25.