Guest User

Untitled

a guest
Feb 22nd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. % Hess.m
  2.  
  3. clear all;
  4. close all;
  5.  
  6. phi = linspace(-45,45,300);
  7. for theta = 50:5:130,
  8. x = tand(phi);
  9. y = 1/tand(theta)./cosd(phi);
  10. if mod(theta,15) == 0,
  11. plot(x,y,'r-');
  12. else
  13. plot(x,y,'r:');
  14. end
  15. hold on;
  16. end
  17.  
  18. beta = linspace(-45,45,300);
  19. for alpha = 50:5:130,
  20. x = 1/tand(alpha)./cosd(beta);
  21. y = tand(beta);
  22. if mod(alpha,15) == 0,
  23. plot(x,y,'b-');
  24. else
  25. plot(x,y,'b:');
  26. end
  27. hold on;
  28. end
  29.  
  30. axis([-1 1 -1 1]);
  31. axis square;
  32.  
  33. xs = -5;
  34. ys = -6;
  35. alpha = 90-xs*5;
  36. theta = 90-ys*5;
  37. phi = atand(cosd(alpha)/sqrt(sind(theta)^2-cosd(alpha)^2));
  38. x = tand(phi);
  39. y = 1/(tand(theta)* cosd(phi));
  40. plot(x,y,'kx');
  41. text(x+0.05,y,['(' num2str(xs) ',' num2str(ys) ')']);
  42. title('Projection Onto Screen');
  43. xlabel('x');
  44. ylabel('y');
Add Comment
Please, Sign In to add comment