Question: Please do not answer problem 3, use problem 3 for referenceto answer question 1, by writing in the matlab code for question 1 a-d 3.
3. a) Rotation of coordinates of a point (x.) about the origin can be carried out by ' cos(0) x-sin(0) y y-sin() x+cos(6)y o()ino) ysin(e) cos() y Where (x, y) is the coordinates of the point p, (x'y) is the new coordinates of the point p after rotation with angle in degrees. Write a function rotate.m file that can carry the calculation of nev coordinate after rotation using equations above. function np - rotate(p,theta) b) Write a script file to test the function by using a triangle with coordinates pl-[1 1], p2-13 7) and p3-12 5] rotate 30 degrees. Plot triangles before and after its rotation (use fill or plot commands) (note: keep your files for the continuation on Exercise 10)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
