SlideShare ist ein Scribd-Unternehmen logo
1 von 2
(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);
Mouth_y(:,s)=y(v0,theta,t, Mouth_y(1,s));
end
for z=1:3
LeftEye_x(:,z)=LeftEye_x(1,z)+x(v0,theta,t);
LeftEye_y(:,z)=y(v0,theta,t, LeftEye_y(1,z));
RightEye_x(:,z)= RightEye_x(1,z)+x(v0,theta,t);
RightEye_y(:,z)=y(v0,theta,t, RightEye_y(1,z));
end
for i=1:9
fill(face_x(i,:),face_y(i,:),'y');
fill(Mouth_x(i,:),Mouth_y(i,:),'r');
fill(LeftEye_x(i,:),LeftEye_y(i,:),'r');
fill(RightEye_x(i,:),RightEye_y(i,:),'r');
axis square;
pause(0.2);
end

Weitere ähnliche Inhalte

Ähnlich wie (MATLAB) Que3a We are going to launch this face upwards at an angle of.docx

Alg April 2, 2009
Alg April 2, 2009Alg April 2, 2009
Alg April 2, 2009
Mr. Smith
 
March 4 and 5, 2009
March 4 and 5, 2009March 4 and 5, 2009
March 4 and 5, 2009
Mr. Smith
 
Solution to me n mine mathematics vii oct 2011
Solution to me n mine mathematics vii oct 2011Solution to me n mine mathematics vii oct 2011
Solution to me n mine mathematics vii oct 2011
Abhishek Mittal
 

Ähnlich wie (MATLAB) Que3a We are going to launch this face upwards at an angle of.docx (20)

borland-style-graphics-for-dev-c.pdf
borland-style-graphics-for-dev-c.pdfborland-style-graphics-for-dev-c.pdf
borland-style-graphics-for-dev-c.pdf
 
Alg April 2, 2009
Alg April 2, 2009Alg April 2, 2009
Alg April 2, 2009
 
GraphTransformations.pptx
GraphTransformations.pptxGraphTransformations.pptx
GraphTransformations.pptx
 
Prova global 2 correção
Prova global 2 correçãoProva global 2 correção
Prova global 2 correção
 
Chapter 6 Balagurusamy Programming ANSI in c
Chapter 6  Balagurusamy Programming ANSI  in cChapter 6  Balagurusamy Programming ANSI  in c
Chapter 6 Balagurusamy Programming ANSI in c
 
Informe laboratorio n°1
Informe laboratorio n°1Informe laboratorio n°1
Informe laboratorio n°1
 
March 4 and 5, 2009
March 4 and 5, 2009March 4 and 5, 2009
March 4 and 5, 2009
 
William hyatt-7th-edition-drill-problems-solution
William hyatt-7th-edition-drill-problems-solutionWilliam hyatt-7th-edition-drill-problems-solution
William hyatt-7th-edition-drill-problems-solution
 
Solution to me n mine mathematics vii oct 2011
Solution to me n mine mathematics vii oct 2011Solution to me n mine mathematics vii oct 2011
Solution to me n mine mathematics vii oct 2011
 
Matematica Basica
Matematica BasicaMatematica Basica
Matematica Basica
 
Control system lab nyquist plot
Control system lab nyquist plotControl system lab nyquist plot
Control system lab nyquist plot
 
A Course in Fuzzy Systems and Control Matlab Chapter Three
A Course in Fuzzy Systems and Control Matlab Chapter ThreeA Course in Fuzzy Systems and Control Matlab Chapter Three
A Course in Fuzzy Systems and Control Matlab Chapter Three
 
Secant Method
Secant MethodSecant Method
Secant Method
 
Review in quadrilaterals [autosaved]
Review in quadrilaterals [autosaved]Review in quadrilaterals [autosaved]
Review in quadrilaterals [autosaved]
 
Homework1
Homework1Homework1
Homework1
 
ملزمة الرياضيات للصف السادس الاحيائي الفصل الاول
ملزمة الرياضيات للصف السادس الاحيائي الفصل الاولملزمة الرياضيات للصف السادس الاحيائي الفصل الاول
ملزمة الرياضيات للصف السادس الاحيائي الفصل الاول
 
CS 354 Object Viewing and Representation
CS 354 Object Viewing and RepresentationCS 354 Object Viewing and Representation
CS 354 Object Viewing and Representation
 
Data Analysis Assignment Help
Data Analysis Assignment Help Data Analysis Assignment Help
Data Analysis Assignment Help
 
3.pdf
3.pdf3.pdf
3.pdf
 
Lecture5_Laplace_ODE.pdf
Lecture5_Laplace_ODE.pdfLecture5_Laplace_ODE.pdf
Lecture5_Laplace_ODE.pdf
 

Mehr von pjoseph6

- What is continuous linked settlement and how does it operate- - What.docx
- What is continuous linked settlement and how does it operate- - What.docx- What is continuous linked settlement and how does it operate- - What.docx
- What is continuous linked settlement and how does it operate- - What.docx
pjoseph6
 
- What is a right-to-work state- What are the advantages or disadvanta.docx
- What is a right-to-work state- What are the advantages or disadvanta.docx- What is a right-to-work state- What are the advantages or disadvanta.docx
- What is a right-to-work state- What are the advantages or disadvanta.docx
pjoseph6
 
- Describe in one or two paragraphs what is Web (8-10 lines) Your desc.docx
- Describe in one or two paragraphs what is Web (8-10 lines) Your desc.docx- Describe in one or two paragraphs what is Web (8-10 lines) Your desc.docx
- Describe in one or two paragraphs what is Web (8-10 lines) Your desc.docx
pjoseph6
 

Mehr von pjoseph6 (10)

-- NaCIO- Bu4NHSO4 EtOAc (ethyl acetate) Benzophenone Benzhydrol Solut.docx
-- NaCIO- Bu4NHSO4 EtOAc (ethyl acetate) Benzophenone Benzhydrol Solut.docx-- NaCIO- Bu4NHSO4 EtOAc (ethyl acetate) Benzophenone Benzhydrol Solut.docx
-- NaCIO- Bu4NHSO4 EtOAc (ethyl acetate) Benzophenone Benzhydrol Solut.docx
 
(Multiple choice) Which one of the following statements is true- Expla.docx
(Multiple choice) Which one of the following statements is true- Expla.docx(Multiple choice) Which one of the following statements is true- Expla.docx
(Multiple choice) Which one of the following statements is true- Expla.docx
 
(Internal controls for plant assets) Harris- CPA- has accepted an enga.docx
(Internal controls for plant assets) Harris- CPA- has accepted an enga.docx(Internal controls for plant assets) Harris- CPA- has accepted an enga.docx
(Internal controls for plant assets) Harris- CPA- has accepted an enga.docx
 
- What is continuous linked settlement and how does it operate- - What.docx
- What is continuous linked settlement and how does it operate- - What.docx- What is continuous linked settlement and how does it operate- - What.docx
- What is continuous linked settlement and how does it operate- - What.docx
 
- What is a right-to-work state- What are the advantages or disadvanta.docx
- What is a right-to-work state- What are the advantages or disadvanta.docx- What is a right-to-work state- What are the advantages or disadvanta.docx
- What is a right-to-work state- What are the advantages or disadvanta.docx
 
(b) Ionization energy generally increases from left to right across th.docx
(b) Ionization energy generally increases from left to right across th.docx(b) Ionization energy generally increases from left to right across th.docx
(b) Ionization energy generally increases from left to right across th.docx
 
- How are corporate hierarchies related to the systems concept-Solutio.docx
- How are corporate hierarchies related to the systems concept-Solutio.docx- How are corporate hierarchies related to the systems concept-Solutio.docx
- How are corporate hierarchies related to the systems concept-Solutio.docx
 
- Describe in one or two paragraphs what is Web (8-10 lines) Your desc.docx
- Describe in one or two paragraphs what is Web (8-10 lines) Your desc.docx- Describe in one or two paragraphs what is Web (8-10 lines) Your desc.docx
- Describe in one or two paragraphs what is Web (8-10 lines) Your desc.docx
 
- Classify each of the following as a pure substance or a mixture- if.docx
- Classify each of the following as a pure substance or a mixture- if.docx- Classify each of the following as a pure substance or a mixture- if.docx
- Classify each of the following as a pure substance or a mixture- if.docx
 
- Below are nominal GDP and GDP deflators for four years- Calculate re.docx
- Below are nominal GDP and GDP deflators for four years- Calculate re.docx- Below are nominal GDP and GDP deflators for four years- Calculate re.docx
- Below are nominal GDP and GDP deflators for four years- Calculate re.docx
 

Kürzlich hochgeladen

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
fonyou31
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 

Kürzlich hochgeladen (20)

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
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);
  • 2. Mouth_y(:,s)=y(v0,theta,t, Mouth_y(1,s)); end for z=1:3 LeftEye_x(:,z)=LeftEye_x(1,z)+x(v0,theta,t); LeftEye_y(:,z)=y(v0,theta,t, LeftEye_y(1,z)); RightEye_x(:,z)= RightEye_x(1,z)+x(v0,theta,t); RightEye_y(:,z)=y(v0,theta,t, RightEye_y(1,z)); end for i=1:9 fill(face_x(i,:),face_y(i,:),'y'); fill(Mouth_x(i,:),Mouth_y(i,:),'r'); fill(LeftEye_x(i,:),LeftEye_y(i,:),'r'); fill(RightEye_x(i,:),RightEye_y(i,:),'r'); axis square; pause(0.2); end