This MATLAB code simulates the motion of a face launched at an angle of 45 degrees. It initializes arrays to store the x and y coordinates of the face, mouth, and eyes over time. It then uses functions x() and y() to calculate the trajectory and animate the motion over 9 time steps, displaying the face at each step.
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
(MATLAB) Que3a We are going to launch this face upwards at an angle of.docx
1. (MATLAB) Que3a We are going to launch this face upwards at an angle of 45degree.
Que3b Use these coordinates to animate the motion of the face.
Solution
clear all
clc
v0=50;
theta=45;
face_x=zeros(9,12);
face_y=zeros(9,12);
Mouth_x=zeros(9,5);
Mouth_y=zeros(9,5);
LeftEye_x=zeros(9,3);
LeftEye_y=zeros(9,3);
RightEye_x=zeros(9,3);
RightEye_y=zeros(9,3);
face_x(1,:)=[10 12 10 13 13 17 17 20 18 20 15 10];
face_y(1,:)=[10 16 18 19 16 16 19 18 16 10 8 10];
Mouth_x(1,:)=[16 14 16 14 15];
Mouth_y(1,:)=[9 11 11 9 8];
LeftEye_x(1,:)=[13 14 14];
LeftEye_y(1,:)=[12 13 12];
RightEye_x(1,:)=[16 16 17];
RightEye_y(1,:)=[12 13 12];
hold on
t=0:7.2/8:7.2;
for w=1:12
face_x(:,w)=face_x(1,w)+x(v0,theta,t);
face_y(:,w)=y(v0,theta,t,face_y(1,w));
end
for s=1:5
Mouth_x(:,s)= Mouth_x(1,s)+x(v0,theta,t);