top of page
Writer's picturejesskesson

Trigonometry calculator

Updated: Jun 10, 2019

We got to play around with a coded calculator on Jupyter. We read the code through step by step to make sure we understood it, and then had a go at changing the code. As it only calculated triangles using the rule Sine = Opposite/Hypotenuse, we had a go at making it calculate another formula.


I, however, ran out of time after going through the code on Jupyter and making notes to make sure I fully understood it.


Sections 1 to 2 of code

The first section of code is basically enforcing that if there isn't an angle, then that's what's being solved. This is the start of a complicated if-else statement.


The next section is an elif statement. This basically means that if the opposite angle is given as 0, then that's what being solved. Most of the code relies on the 'what if' factor, and the fact that something will always be missing when calculating Trigonometry.


Sections 3 to 4 of code

The finally part of the if-else, which functions as a final filter to the code. If there is a 0 here, this is what needs to be solved. An If-Else statement is when a part of code will only work if certain criteria are met. For example, if you have enter the number 1 into the code, you'll get a response. If any other number is entered, the program will say nothing. A While statement is also a certain criteria that the input/code must meet. They can be loops, as they will keep iterating until the conditions are met.


At the bottom was three already written notes, explaining how to type in numbers in the correct order to what you want it to solve.

0 views0 comments

Recent Posts

See All

Comentarios


bottom of page