Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % Hess.m
- clear all;
- close all;
- phi = linspace(-45,45,300);
- for theta = 50:5:130,
- x = tand(phi);
- y = 1/tand(theta)./cosd(phi);
- if mod(theta,15) == 0,
- plot(x,y,'r-');
- else
- plot(x,y,'r:');
- end
- hold on;
- end
- beta = linspace(-45,45,300);
- for alpha = 50:5:130,
- x = 1/tand(alpha)./cosd(beta);
- y = tand(beta);
- if mod(alpha,15) == 0,
- plot(x,y,'b-');
- else
- plot(x,y,'b:');
- end
- hold on;
- end
- axis([-1 1 -1 1]);
- axis square;
- xs = -5;
- ys = -6;
- alpha = 90-xs*5;
- theta = 90-ys*5;
- phi = atand(cosd(alpha)/sqrt(sind(theta)^2-cosd(alpha)^2));
- x = tand(phi);
- y = 1/(tand(theta)* cosd(phi));
- plot(x,y,'kx');
- text(x+0.05,y,['(' num2str(xs) ',' num2str(ys) ')']);
- title('Projection Onto Screen');
- xlabel('x');
- ylabel('y');
Add Comment
Please, Sign In to add comment