SlideShare a Scribd company logo
1 of 13
24-Feb-20
Trigonometry
Instant Trig
 Trigonometry is math, so many people find it scary
 It’s usually taught in a one-semester high-school course
 However, 95% of all the “trig” you’ll ever need to know
can be covered in 15 minutes
 And that’s what we’re going to do now
Angles add to 180°
 The angles of a triangle always add up to 180°
44°
68° 68°
20°
120°
30°
44°
68°
+ 68°
180°
20°
30°
180°
+ 130°
Right triangles
 We only care about right triangles
 A right triangle is one in which one of the angles is 90°
 Here’s a right triangle:
 We call the longest side the hypotenuse
 We pick one of the other angles--not the right angle
 We name the other two sides relative to that angle
Here’s the
right angle
Here’s the angle
we are looking at
adjacent
opposite
The Pythagorean Theorem
 If you square the length of the
two shorter sides and add
them, you get the square of the
length of the hypotenuse
 adj2 + opp2 = hyp2
 32 + 42 = 52, or 9 + 16 = 25
 hyp = sqrt(adj2 + opp2)
 5 = sqrt(9 + 16)
5-12-13
 There are few triangles with
integer sides that satisfy the
Pythagorean formula
 3-4-5 and its
multiples (6-8-10, etc.)
are the best known
 5-12-13 and its multiples
form another set
 25 + 144 = 169
adj
opp
Ratios
 Since a triangle has three
sides, there are six ways to
divide the lengths of the sides
 Each of these six ratios has a
name (and an abbreviation)
 Three ratios are most used:
 sine = sin = opp / hyp
 cosine = cos = adj / hyp
 tangent = tan = opp / adj
 The other three ratios are
redundant with these and can
be ignored
 The ratios depend on the
shape of the triangle (the
angles) but not on the size
adjacent
opposite
adjacent
opposite
Using the ratios
 With these functions, if you know an angle (in addition to the
right angle) and the length of a side, you can compute all other
angles and lengths of sides
 If you know the angle marked in red (call it A) and you know
the length of the adjacent side, then
 tan A = opp / adj, so length of opposite side is given by
opp = adj * tan A
 cos A = adj / hyp, so length of hypotenuse is given by
hyp = adj / cos A
adjacent
opposite
Java methods in java.lang.Math
 public static double sin(double a)
 If a is zero, the result is zero
 public static double cos(double a)
 public static double sin(double a)
 If a is zero, the result is zero
 However: The angle a must be measured in radians
 Fortunately, Java has these additional methods:
 public static double toRadians(double degrees)
 public static double toDegrees(double radians)
The hard part
 If you understood this lecture, you’re in great shape for
doing all kinds of things with basic graphics
 Here’s the part I’ve always found the hardest:
 Memorizing the names of the ratios
 sin = opp / hyp
 cos = adj / hyp
 tan = opp / adj adjacent
opposite
Mnemonics from wikiquote
 The formulas for right-triangle trigonometric functions
are:
 Sine = Opposite / Hypotenuse
 Cosine = Adjacent / Hypotenuse
 Tangent = Opposite / Adjacent
 Mnemonics for those formulas are:
 Some Old Horse Caught Another Horse Taking Oats Away
 Saints On High Can Always Have Tea Or Alcohol
You are at: (x, y)
You want to move h units in the
angle  direction, to (x1, y1):
So you make a right triangle...
And you label it...
hyp
opp
adj
And you compute:
x1 = x + adj = x + hyp * (adj/hyp) = x + hyp * cos 
y1 = y - opp = y - hyp * (opp/hyp) = y - hyp * sin 
This is the first point in your “Turtle” triangle
Find the other points similarly...
Drawing a “Turtle”
The End

More Related Content

What's hot

Right triangle trigonometry
Right triangle trigonometryRight triangle trigonometry
Right triangle trigonometryJessica Garcia
 
Right triangles
Right trianglesRight triangles
Right triangleszanstett
 
Labeling Trigonometry Triangles
Labeling Trigonometry TrianglesLabeling Trigonometry Triangles
Labeling Trigonometry TrianglesPassy World
 
Obj. 40 Trigonometry
Obj. 40 TrigonometryObj. 40 Trigonometry
Obj. 40 Trigonometrysmiller5
 
The Pythagorean Theorem
The Pythagorean TheoremThe Pythagorean Theorem
The Pythagorean Theoremblue
 
The Tangent Ratio
The Tangent RatioThe Tangent Ratio
The Tangent RatioPassy World
 
Trigonometric ratios
Trigonometric ratiosTrigonometric ratios
Trigonometric ratiosAD Firdausi
 
Obj. 43 Laws of Sines and Cosines
Obj. 43 Laws of Sines and CosinesObj. 43 Laws of Sines and Cosines
Obj. 43 Laws of Sines and Cosinessmiller5
 
Trigonometric ratios
Trigonometric ratiosTrigonometric ratios
Trigonometric ratiosAzeemAbro
 
Trigonometric ratios
Trigonometric ratiosTrigonometric ratios
Trigonometric ratiosSuman Bargav
 
4.1 trig ratios
4.1 trig ratios4.1 trig ratios
4.1 trig ratioshisema01
 
Wynberg girls high-louise keegan-maths-grade11-trigonometry revision
Wynberg girls high-louise keegan-maths-grade11-trigonometry revisionWynberg girls high-louise keegan-maths-grade11-trigonometry revision
Wynberg girls high-louise keegan-maths-grade11-trigonometry revisionWynberg Girls High
 
Pythagorean Theorem Tutorial
 Pythagorean Theorem Tutorial Pythagorean Theorem Tutorial
Pythagorean Theorem Tutorialsalynkatko
 
Pythagorean Theorem
Pythagorean TheoremPythagorean Theorem
Pythagorean TheoremLori Smith
 
Pythagorean Theorem Lesson
Pythagorean Theorem LessonPythagorean Theorem Lesson
Pythagorean Theorem LessonKe4498
 
4.11.5 Solving Right Triangles
4.11.5 Solving Right Triangles4.11.5 Solving Right Triangles
4.11.5 Solving Right Trianglessmiller5
 

What's hot (20)

The basics of trigonometry
The basics of trigonometryThe basics of trigonometry
The basics of trigonometry
 
Right triangle trigonometry
Right triangle trigonometryRight triangle trigonometry
Right triangle trigonometry
 
Right triangles
Right trianglesRight triangles
Right triangles
 
Labeling Trigonometry Triangles
Labeling Trigonometry TrianglesLabeling Trigonometry Triangles
Labeling Trigonometry Triangles
 
Trigonometry
TrigonometryTrigonometry
Trigonometry
 
Trigonometry
TrigonometryTrigonometry
Trigonometry
 
Obj. 40 Trigonometry
Obj. 40 TrigonometryObj. 40 Trigonometry
Obj. 40 Trigonometry
 
The Pythagorean Theorem
The Pythagorean TheoremThe Pythagorean Theorem
The Pythagorean Theorem
 
The Tangent Ratio
The Tangent RatioThe Tangent Ratio
The Tangent Ratio
 
Trigonometric ratios
Trigonometric ratiosTrigonometric ratios
Trigonometric ratios
 
Obj. 43 Laws of Sines and Cosines
Obj. 43 Laws of Sines and CosinesObj. 43 Laws of Sines and Cosines
Obj. 43 Laws of Sines and Cosines
 
Trigonometric ratios
Trigonometric ratiosTrigonometric ratios
Trigonometric ratios
 
Trigonometric ratios
Trigonometric ratiosTrigonometric ratios
Trigonometric ratios
 
4.1 trig ratios
4.1 trig ratios4.1 trig ratios
4.1 trig ratios
 
Wynberg girls high-louise keegan-maths-grade11-trigonometry revision
Wynberg girls high-louise keegan-maths-grade11-trigonometry revisionWynberg girls high-louise keegan-maths-grade11-trigonometry revision
Wynberg girls high-louise keegan-maths-grade11-trigonometry revision
 
Pythagorean Theorem Tutorial
 Pythagorean Theorem Tutorial Pythagorean Theorem Tutorial
Pythagorean Theorem Tutorial
 
Pythagorean Theorem
Pythagorean TheoremPythagorean Theorem
Pythagorean Theorem
 
Pythagorean Theorem Lesson
Pythagorean Theorem LessonPythagorean Theorem Lesson
Pythagorean Theorem Lesson
 
Ankit1
Ankit1Ankit1
Ankit1
 
4.11.5 Solving Right Triangles
4.11.5 Solving Right Triangles4.11.5 Solving Right Triangles
4.11.5 Solving Right Triangles
 

Similar to 21 trigonometry

introduction to trigonometry
introduction to trigonometryintroduction to trigonometry
introduction to trigonometrysudarshanamigo
 
Math lecture 8 (Introduction to Trigonometry)
Math lecture 8 (Introduction to Trigonometry)Math lecture 8 (Introduction to Trigonometry)
Math lecture 8 (Introduction to Trigonometry)Osama Zahid
 
Solving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptSolving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptJasonTagapanGulla
 
Trigonometry ratios in right triangle
Trigonometry ratios in right triangleTrigonometry ratios in right triangle
Trigonometry ratios in right triangleJason Teel
 
Trigonometry[1]
Trigonometry[1]Trigonometry[1]
Trigonometry[1]daisyrock
 
Pre-5.1 - trigonometry ratios in right triangle and special right triangles.ppt
Pre-5.1 - trigonometry ratios in right triangle and special right triangles.pptPre-5.1 - trigonometry ratios in right triangle and special right triangles.ppt
Pre-5.1 - trigonometry ratios in right triangle and special right triangles.pptMariOsnolaSan
 
Precalculus August 28 trigonometry ratios in right triangle and special righ...
Precalculus August 28  trigonometry ratios in right triangle and special righ...Precalculus August 28  trigonometry ratios in right triangle and special righ...
Precalculus August 28 trigonometry ratios in right triangle and special righ...2236531
 
GCSE-TrigonometryOfRightAngledTriangles.pptx
GCSE-TrigonometryOfRightAngledTriangles.pptxGCSE-TrigonometryOfRightAngledTriangles.pptx
GCSE-TrigonometryOfRightAngledTriangles.pptxHasifa5
 
Trig mini unit
Trig mini unitTrig mini unit
Trig mini unithisema01
 
Trig right triangle trig
Trig  right triangle trigTrig  right triangle trig
Trig right triangle trigcosmocog
 
Math Analysis[1][2]
Math Analysis[1][2]Math Analysis[1][2]
Math Analysis[1][2]kmhiggins
 
Kristi's Trig. for Dummies
Kristi's Trig. for DummiesKristi's Trig. for Dummies
Kristi's Trig. for Dummiesdaisyrock
 
Summary of trigonometric formulas2
Summary of trigonometric formulas2Summary of trigonometric formulas2
Summary of trigonometric formulas2varunsingh383
 

Similar to 21 trigonometry (20)

21 trigonometry
21 trigonometry21 trigonometry
21 trigonometry
 
introduction to trigonometry
introduction to trigonometryintroduction to trigonometry
introduction to trigonometry
 
21 trigonometry
21 trigonometry21 trigonometry
21 trigonometry
 
24 trigonometry(1)
24 trigonometry(1)24 trigonometry(1)
24 trigonometry(1)
 
.
..
.
 
Math lecture 8 (Introduction to Trigonometry)
Math lecture 8 (Introduction to Trigonometry)Math lecture 8 (Introduction to Trigonometry)
Math lecture 8 (Introduction to Trigonometry)
 
Solving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptSolving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.ppt
 
Trigonometry ratios in right triangle
Trigonometry ratios in right triangleTrigonometry ratios in right triangle
Trigonometry ratios in right triangle
 
Trigonometry docs
Trigonometry docsTrigonometry docs
Trigonometry docs
 
Trigonometry[1]
Trigonometry[1]Trigonometry[1]
Trigonometry[1]
 
Pre-5.1 - trigonometry ratios in right triangle and special right triangles.ppt
Pre-5.1 - trigonometry ratios in right triangle and special right triangles.pptPre-5.1 - trigonometry ratios in right triangle and special right triangles.ppt
Pre-5.1 - trigonometry ratios in right triangle and special right triangles.ppt
 
Precalculus August 28 trigonometry ratios in right triangle and special righ...
Precalculus August 28  trigonometry ratios in right triangle and special righ...Precalculus August 28  trigonometry ratios in right triangle and special righ...
Precalculus August 28 trigonometry ratios in right triangle and special righ...
 
GCSE-TrigonometryOfRightAngledTriangles.pptx
GCSE-TrigonometryOfRightAngledTriangles.pptxGCSE-TrigonometryOfRightAngledTriangles.pptx
GCSE-TrigonometryOfRightAngledTriangles.pptx
 
Trig mini unit
Trig mini unitTrig mini unit
Trig mini unit
 
Trig right triangle trig
Trig  right triangle trigTrig  right triangle trig
Trig right triangle trig
 
Hoho
HohoHoho
Hoho
 
Math Analysis[1][2]
Math Analysis[1][2]Math Analysis[1][2]
Math Analysis[1][2]
 
Larson 4.3
Larson 4.3Larson 4.3
Larson 4.3
 
Kristi's Trig. for Dummies
Kristi's Trig. for DummiesKristi's Trig. for Dummies
Kristi's Trig. for Dummies
 
Summary of trigonometric formulas2
Summary of trigonometric formulas2Summary of trigonometric formulas2
Summary of trigonometric formulas2
 

Recently uploaded

DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 

Recently uploaded (20)

DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 

21 trigonometry

  • 2. Instant Trig  Trigonometry is math, so many people find it scary  It’s usually taught in a one-semester high-school course  However, 95% of all the “trig” you’ll ever need to know can be covered in 15 minutes  And that’s what we’re going to do now
  • 3. Angles add to 180°  The angles of a triangle always add up to 180° 44° 68° 68° 20° 120° 30° 44° 68° + 68° 180° 20° 30° 180° + 130°
  • 4. Right triangles  We only care about right triangles  A right triangle is one in which one of the angles is 90°  Here’s a right triangle:  We call the longest side the hypotenuse  We pick one of the other angles--not the right angle  We name the other two sides relative to that angle Here’s the right angle Here’s the angle we are looking at adjacent opposite
  • 5. The Pythagorean Theorem  If you square the length of the two shorter sides and add them, you get the square of the length of the hypotenuse  adj2 + opp2 = hyp2  32 + 42 = 52, or 9 + 16 = 25  hyp = sqrt(adj2 + opp2)  5 = sqrt(9 + 16)
  • 6. 5-12-13  There are few triangles with integer sides that satisfy the Pythagorean formula  3-4-5 and its multiples (6-8-10, etc.) are the best known  5-12-13 and its multiples form another set  25 + 144 = 169 adj opp
  • 7. Ratios  Since a triangle has three sides, there are six ways to divide the lengths of the sides  Each of these six ratios has a name (and an abbreviation)  Three ratios are most used:  sine = sin = opp / hyp  cosine = cos = adj / hyp  tangent = tan = opp / adj  The other three ratios are redundant with these and can be ignored  The ratios depend on the shape of the triangle (the angles) but not on the size adjacent opposite adjacent opposite
  • 8. Using the ratios  With these functions, if you know an angle (in addition to the right angle) and the length of a side, you can compute all other angles and lengths of sides  If you know the angle marked in red (call it A) and you know the length of the adjacent side, then  tan A = opp / adj, so length of opposite side is given by opp = adj * tan A  cos A = adj / hyp, so length of hypotenuse is given by hyp = adj / cos A adjacent opposite
  • 9. Java methods in java.lang.Math  public static double sin(double a)  If a is zero, the result is zero  public static double cos(double a)  public static double sin(double a)  If a is zero, the result is zero  However: The angle a must be measured in radians  Fortunately, Java has these additional methods:  public static double toRadians(double degrees)  public static double toDegrees(double radians)
  • 10. The hard part  If you understood this lecture, you’re in great shape for doing all kinds of things with basic graphics  Here’s the part I’ve always found the hardest:  Memorizing the names of the ratios  sin = opp / hyp  cos = adj / hyp  tan = opp / adj adjacent opposite
  • 11. Mnemonics from wikiquote  The formulas for right-triangle trigonometric functions are:  Sine = Opposite / Hypotenuse  Cosine = Adjacent / Hypotenuse  Tangent = Opposite / Adjacent  Mnemonics for those formulas are:  Some Old Horse Caught Another Horse Taking Oats Away  Saints On High Can Always Have Tea Or Alcohol
  • 12. You are at: (x, y) You want to move h units in the angle  direction, to (x1, y1): So you make a right triangle... And you label it... hyp opp adj And you compute: x1 = x + adj = x + hyp * (adj/hyp) = x + hyp * cos  y1 = y - opp = y - hyp * (opp/hyp) = y - hyp * sin  This is the first point in your “Turtle” triangle Find the other points similarly... Drawing a “Turtle”