Click here to Skip to main content
13,198,563 members (52,033 online)
Click here to Skip to main content
Add your own
alternative version


90 bookmarked
Posted 27 Nov 2011

The right-angle triangle: Meet your new best friend

, 5 Feb 2014
Rate this:
Please Sign up or sign in to vote.
Did you skip class the day trigonometry was taught? This article will explain what you’ve been missing all these years.


Once in a while a topic is presented and its usefulness is instantly apparent. You immediately ask yourself how you got through life thus far without knowing about such an amazing concept.

I haven’t studied math since high school, but I still remember one fateful morning in geometry class that changed my life.


As a youth back in school it wasn’t uncommon when presented with a new topic, to hear comments like “When will I ever use this in life?” I remember having one of these moments in grade 10 math class, when we spent a solid five months studying parabolas and quadratic equations. In hindsight, the problem was that we weren’t given any context for how these curves could be useful. The teacher taught that which the curriculum dictated, but any significance of these equations was lost in translation.

The Triangle

I think it was in grade 7 that we were presented with the Pythagorean theorem. With the knowledge of the lengths of two sides of a right-angle triangle, the theorem explains how to determine the length of the third side.

Pythagorean Triple

How useful! With this knowledge you can safely position an extension ladder to clean out the eaves troughs, calculate the shortest distance between two points on a map, or buy enough wallpaper to cover an angled wall knowing only the dimensions of the other walls in the room.

Note: Americans call these “right triangles”. Please forgive them.

It felt like I was missing out on the full potential of this handy little triangle though. I wasn’t sure what else it could do, but something was missing.

One morning in grade 13 geometry class, the missing pieces presented themselves. The angles! Of course! Sure, the Pythagorean Theorem explained the relationship between the sides, but we had forgotten about the angles. In grade 7 we accepted that one of the angles is 90° and that all three angles total 180° but we left it at that.


That fateful trigonometry lesson in grade 13 explained a lot: how to determine any angle in the triangle, knowing the length of two sides; how to determine the length of any side, knowing the length of one side and one angle; and just for what purpose those mysterious tan, cos, and sin buttons on my calculator were.

Right-angle TriangleLet’s review.

  1. All triangles have three sides.
  2. In a right-angle triangle, two of those sides meet at a right angle (90°).
  3. The third side, called the hypotenuse, completes the shape.

Here’s a triangle. The little square opposite the hypotenuse denotes that it is a right-angle triangle (if it’s not present, we can not assume the angle is 90°).

To make the rest of this lesson easy to understand, let’s draw a little guy next to one of the points (called vertices) of the triangle. His name is Dieter. The usefulness of this simple act cannot be overstated, because now we can use relational terms to describe the two unnamed sides. The side next to Dieter, the one adjacent to him is called… the adjacent side. The side opposite him is… you guessed it, the opposite side.

Now that the sides are named we can apply some handy formulae. Don’t worry; they’re as simple as Pythagoras’ famous formula. We’ll use the symbol θ (Greek letter theta) to represent the angle closest to Dieter. We’ll abbreviate opposite and adjacent to OPP and ADJ.

sin θ = OPP / HYP
cos θ = ADJ / HYP
tan θ = OPP / ADJ

“Why aren’t you writing this down?” The sine, cosine, and tangent functions are called trigonometric functions.

Dieter is at the bottom of a hill at sea-level. He’s going to climb to the top. What will his altitude be when he reaches the top?

Let’s say the angle θ is 25° and the hypotenuse is 100 metres. His final altitude is equal to the length of the opposite side.

sin θ = OPP / HYP
    OPP = HYP · sin θ
    OPP = 100 · sin(25°)
    OPP ≈ 100 · 0.4226
    OPP ≈ 42.26

Dieter’s altitude will be about 42.26m above sea level.

Tip: Make sure your calculator is set to degrees, not radians, when working with degrees.

We can also do the opposite, determine the angle using inverse trigonometric functions. If Dieter walked 100m up the hill and at the top his altimeter reads 35m, what is the angle of incline?

sin θ = OPP / HYP
     θ = sinˉ¹(OPP / HYP) = arcsin(OPP / HYP)
     θ = arcsin(35 / 100)
     θ = arcsin(0.35)
     θ ≈ 20.4°

The angle of incline is about 20.4°. The inverse of the sine function is called the arcsine and is usually denoted by the negative exponent (don’t let it confuse you).

Text on a circle pathCircles

If you think about it, every point on the circumference of a circle can be expressed in terms of triangles.

Here’s a task I’ve had to do many times, like when I wrote the Shoe Label preview for Mabel’s Labels. When placing the letter d in the illustration, what are the x and y coordinates if we need to rotate the text 30° and the radius is 50?

sin θ = OPP / HYP
     x = sin θ · r
     x = sin(30) · 50
     x = 0.5 · 50
     x = 25

cos θ = ADJ / HYP
     y = cos θ · r
     y = cos(30) · 50
     y ≈ 0.866 · 50
     y ≈ 43

The letter d can be placed at coordinates (25,43) at an angle of 30°.


The demonstration application uses Silverlight to demonstrate the concepts of right-angle triangles and tangential functions to animate an elastic collision between a moving ball and a fixed post.

There isn’t anything particularly interesting about the application, but you can see these concepts expressed in code. The animation doesn’t take advantage of Silverlight’s animation features, so it may be less than smooth.



If you remember three simple formulae and learn to use three buttons on your calculator, you’ll be able to amaze the other 72%¹ of the population who can not.


¹ When I originally wrote this article, I made up a statistic for the percentage of people that are able to use these formulae. I became curious about the actual number, so I initiated a research project.

In my experiment I paid 547 people from around the world (using Amazon Mechanical Turk) USD 0.01 to solve Dieter’s problem above. The answers were multiple choice, including six numeric answers in addition to “I have no idea how to solve this.” and “I remember doing this in school, but I forget how to solve it.”. A penny isn’t much money, but they weren’t told that they would get paid whether or not the solution was correct. They were given five minutes to solve the problem. For those with a working knowledge, the problem could easily be solved in about thirty seconds. Some might have gone to Wikipedia and figured it out; others might have just clicked anything to move on to the next HIT. The results were as follows:

  • 8% “I have no idea”
  • 40% “I remember doing this in school”
  • 24% An incorrect answer or guess
  • 28% The correct answer


These things take a long time to write. If you like it, please rate it.

The animated Pythagorean triplet is © 2007 GNOME Icon Artists and is used under the terms of the Creative Commons Attribution-ShareAlike 3.0.

Dieter is © 2007 AmericanExplorer13 and is used under the terms of the GNU GPL.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Yvan Rodrigues
Systems Engineer Clearpath Robotics
Canada Canada
Yvan Rodrigues has 25 years of experience in information systems and software development for the industry. He is Senior Systems Developer at Clearpath Robotics

He is a Certified Technician (C.Tech.), a professional designation granted by the Institute of Engineering Technology of Ontario (IETO).

Yvan draws on experience as owner of Red Cell Innovation Inc., Mabel's Labels Inc. as Manager of Systems and Development, and the University of Waterloo as Information Systems Manager.

Yvan supports open-source software. He is a committer for SharpKit (C# to Javascript cross-compiler) and WebIssues (Issue/Ticket Management System), TinyMCE (JavaScript editor), and contributes to MySQL, Ghostscript, iTextSharp, Bacula, FreeBSD, and Xamarin.

You may also be interested in...


Comments and Discussions

GeneralSimple, but incredibly useful Pin
GladToBeGrey11-Feb-14 2:19
memberGladToBeGrey11-Feb-14 2:19 
Question5 - For Highlighting A Dying Art Pin
Member 96667286-Feb-14 8:46
memberMember 96667286-Feb-14 8:46 
AnswerRe: 5 - For Highlighting A Dying Art Pin
Yvan Rodrigues6-Feb-14 8:54
professionalYvan Rodrigues6-Feb-14 8:54 
GeneralRe: 5 - For Highlighting A Dying Art Pin
Member 96667286-Feb-14 9:04
memberMember 96667286-Feb-14 9:04 
General"right triangles" Pin
Member 103795816-Feb-14 7:15
memberMember 103795816-Feb-14 7:15 
GeneralRe: "right triangles" Pin
Yvan Rodrigues6-Feb-14 7:18
professionalYvan Rodrigues6-Feb-14 7:18 
GeneralRe: "right triangles" Pin
Chris Trout6-Feb-14 7:35
professionalChris Trout6-Feb-14 7:35 
AnswerRe: "right triangles" Pin
Yvan Rodrigues6-Feb-14 7:40
professionalYvan Rodrigues6-Feb-14 7:40 
GeneralMy vote of 5 Pin
loyal ginger6-Feb-14 7:04
memberloyal ginger6-Feb-14 7:04 
GeneralRe: My vote of 5 Pin
Member 96667286-Feb-14 8:53
memberMember 96667286-Feb-14 8:53 
AnswerRe: My vote of 5 Pin
Yvan Rodrigues6-Feb-14 8:59
professionalYvan Rodrigues6-Feb-14 8:59 
QuestionMy rating of 5 - and a bit more information. Pin
Bill_Hallahan5-Feb-14 16:18
memberBill_Hallahan5-Feb-14 16:18 
Excellent article. I'm an engineer and really into mathematics, so please allow me to add a bit more information, some of which you alluded to in your article.

You wrote:
sin θ = OPP / HYP
cos θ = ADJ / HYP
tan θ = OPP / ADJ

That is completely correct, however, that is not the formal mathematical definition for the cosine and the sine.

The formal mathematical definitions of the cosine and the sine is related to the unit circle. You show in your circle diagram how all right triangles with a fixed length hypotenuse of r can by seen on a circle with radius r.

The unit circle in the x, y Cartesian coordinate system is defined by the equation:
x^2 + y^2 = 1

Where x^2 means "x squared".
It's easy to see the Pythagorean theorem in the formula.

At each point on the circle, there is an angle formed between the point on the circle and the x axis. The x value of the point on the circle is the cosine of that angle and the y value of the point is the sine of the angle. In other words, all cosine and sine values are points on the unit circle. Look at the triangle in your circle diagram. The angle that I am referring to is the angle in the triangle that is closest to the center of the circle.

The formal definition of the tangent of the angle P is:
          sin P
tan P =  --------
          cos P

And, of course, tan P is undefined when the cosine of P is 0, which happens at angles that are an odd multiple of plus or minus 90 degrees. The tangent approaches infinity as it approaches these angles.

That all leads to the triangle formulas for the cosine and sine you showed. More can be derived from the circle formula that is not directly related to triangles.

By the way, a circle with radius r with the center at the origin (the origin being the point (0, 0)), is defined by the equation:
x^2 + y^2 = r^2

Each point on that circle has (x, y) values of (r cos P and r sin P)

Finally, as a point of interest, a circle with center (h, k) and a radius of r is defined by:
(x - h)^2 + (y - k)^2 = r^2

So, when x is h, x - h is 0, and when y is k, y - k is 0. So subtracting h from x and k from y respectively shifts the origin of the simple circle formula from the point (0, 0) to the point (h, k).


While angles in trigonometry are sometimes measured in "degrees", in mathematics, angles are often measured in "radians."

Radian measure uses the distance going counterclockwise around the circumference of the unit circle and starting on the x axis at the value x = 1.0. Since the circle has a radius of 1, the distance around the circle is 2 Pi (where Pi is approximately 3.1415926535 ...).
  0 degrees =   0 radians.
 90 degrees =   Pi/2 radians
180 degrees =   Pi radians
270 degrees =   (3 Pi)/2 radians
360 degrees =   2 Pi radians, which of course is also 0 degrees or 0 radians!

You can add or subtract any multiple of 2 Pi from any angle in radians and the angle stays the same, just as you could add or subtract any multiple of 360 from the angle in degrees and the angle would stay the same.

modified 16-Feb-14 20:53pm.

AnswerRe: My rating of 5 - and a bit more information. Pin
Member 96667286-Feb-14 9:20
memberMember 96667286-Feb-14 9:20 
AnswerRe: My rating of 5 - and a bit more information. Pin
Yvan Rodrigues6-Feb-14 9:26
professionalYvan Rodrigues6-Feb-14 9:26 
GeneralRe: My rating of 5 - and a bit more information. Pin
Member 96667286-Feb-14 9:29
memberMember 96667286-Feb-14 9:29 
GeneralRe: My rating of 5 - and a bit more information. Pin
Member 96667286-Feb-14 9:37
memberMember 96667286-Feb-14 9:37 
GeneralRe: My rating of 5 - and a bit more information. Pin
Yvan Rodrigues6-Feb-14 9:38
professionalYvan Rodrigues6-Feb-14 9:38 
GeneralRe: My rating of 5 - and a bit more information. Pin
Bill_Hallahan7-Feb-14 17:43
memberBill_Hallahan7-Feb-14 17:43 
QuestionGreat article about trigonometry Pin
Volynsky Alex5-Feb-14 9:00
professionalVolynsky Alex5-Feb-14 9:00 
GeneralMy vote of 5 Pin
TheBlackCap13-Nov-12 6:40
memberTheBlackCap13-Nov-12 6:40 
GeneralAmazing Pin
Berkay Gürsoy1-Nov-12 6:02
memberBerkay Gürsoy1-Nov-12 6:02 
GeneralMy vote of 5 Pin
DaveAuld24-Oct-12 2:39
mentorDaveAuld24-Oct-12 2:39 
AnswerRe: My vote of 5 Pin
Yvan Rodrigues24-Oct-12 2:55
subeditorYvan Rodrigues24-Oct-12 2:55 
GeneralRe: My vote of 5 Pin
DaveAuld24-Oct-12 2:56
mentorDaveAuld24-Oct-12 2:56 
GeneralMy vote of 5 Pin
Forogar8-Jul-12 10:54
memberForogar8-Jul-12 10:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.171020.1 | Last Updated 5 Feb 2014
Article Copyright 2011 by Yvan Rodrigues
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid