hiddenGem

Object in Front of Concave Mirror

Jul 26th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.56 KB | None | 0 0
  1. %% Object in Front of Concave Mirror
  2. % Determines the focal length image distance, magnification and magnitude
  3. % of the image height in a concave mirror
  4.  
  5. % Inputs and Variables
  6. h = input('Height of Object\n');
  7. r = input('Radius of mirror\n');
  8. d = input('Distance of Object\n');
  9.  
  10. % Outputs and Equations
  11. focal = r/2;
  12. i = focal*d/(d-focal);
  13. magf = -i/d;
  14. magn = magf*h;
  15. fprintf(['The focal length: %.3e m\n'...
  16.          'The image distance: %.3e m\n'...
  17.          'The magnification is: %.3e\n'...
  18.          'The image height is: %.3e m\n'], focal, i,magf,magn)
  19.  
Advertisement
Add Comment
Please, Sign In to add comment