This was my very first personal project aside from programs that I was assigned to code in my first college computer science class. Reminder that I’m still a high school senior, so in case you’re wondering, I honestly had a lot of time on my hands.
Purpose
This program is designed to take in 3 different values of a triangle’s sides, angles, or area and solve for the remaining 4 values. Two disclaimers:
– The only combination of values which the program cannot solve the rest of the triangle using is 3 angles (it’s mathematically and logically impossible to solve a triangle based only off of its angles)
– The user may not enter a value for the area, as the area can only be solved for (that’s not a mathematical fact; I’d just rather solve a triangle using its sides and/or angles.
A feature that I also decided to include for fun is the ability to store multiple triangles along with its measurements in a list so that the user can keep as many triangles as they want… because why not, I guess.
My inspiration
I made this program for probably the most insignificant reason for which I will ever code programs: I wanted to save time on my Pre-Calculus semester final exam–keep in mind that I was (and still am) “quarantining” at home at the time of the exam, so I conveniently had access to my laptop during school. Ah yes, it was a glorious 10 minutes of manual calculations that I managed to avoid with the help of upwards of 300 lines of code, 3 straight weeks of devotion to the project, and only an hour of tears of frustration. No regrets then, a little regret now…
Jokes aside, despite the extensive time and effort that I knew would take to create this program before my exam, I was still very eager to try my hand at trigonometric calculations through code. Throughout my first 2.5 years of computer science classes prior, I had only used the most basic math functions including addition and subtraction, multiplication and division, and modulus. However, I had done some reading on more advanced math functions like trigonometry (duh), exponents, and roots a week before conceptualizing the program, so I decided to give it a shot.
In the end, it was ultimately the most complex and time-consuming program I have legitimately coded in my life so far, so you could imagine how satisfying it felt to input values for three sides of a triangle and receive accurate output values for all the remaining angles and area variables.