This preview shows pages 1–4. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: NAME: .................................................................. AME 150  Midterm 2 03/30/06 Closed book, closed notes, no calculator. Problem 1. (30 points). A light ray is reflected in a corner formed by two flat mirrors, one placed along xaxis and the other along yaxis. The incoming ray arrives from above at an angle of 45 degrees with respect to the normal to the vertical mirror and strikes the mirror at x = 0 and y = 1. Write a MATLAB script that makes a plot of the incoming ray and all reflected rays in a domain 0 x 2, 0 y 2. Label all axes and provide a title Light reflection in a corner. Problem 2. (40 points) Factorial is defined for any nonnegative integer as n ! = 1 , if n=0 , n ! = 1 2 3 . . . n, if n 6 = 0 . Denote n ! as nf act in MATLAB syntax and write statements to calculate it for an arbitrary non negative integer n 1. (20 points) using ifelse and while loop constructs 2. (20 points) using ifelse and for loop constructs Problem 3.Problem 3....
View
Full
Document
This note was uploaded on 06/01/2008 for the course AME 150L taught by Professor Domaradzki during the Spring '08 term at USC.
 Spring '08
 Domaradzki

Click to edit the document details