# Trigonometry Calculator

Back when I was learning Trig, which was 2017 (8th grade), I came across many problems where you use identities to solve problems, and then use a calculator to round of your answer when it has multiple decimals. Whenever I took the calculator, entered the sum, and tried to round off, I would always make silly mistake (being the dunderhead I am), so I wanted to use my programming knowledge in JavaScript, to create a calculator, that would round off the digits for me, along with calculation the trig ratios for any number.

I had made it back then, but it still had a few bugs. I found it again when I was recently browsing through my old JavaScript codes.

I am working on it again, so I though I'll share the link to it here for everyone to see -

Trigonometry Calculator (with inbuilt round off function!)

You can suggest ideas for me to add, and give feedback about it or just discuss any topic of Trigonometry here.

I would also like to see if this can be done with Python, but as I don't know Python, I didn't try it. If someone has found or made the Python code for this, please do share with me.

I know it looks horrible, so I am learning HTML/CSS styling to make it look better, so I will be editing it shortly.

Here is a preview of how it looks(or rather how bad it looks :P) -

 Normally how it looks When values are typed in and a button is clicked

(Also, I know a round off function is kinda lazy, but hey, we're all trying to make life easier, aren't we?)

Note by Percy Jackson
1 month, 1 week ago

This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.

When posting on Brilliant:

• Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .
• Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting "I don't understand!" doesn't help anyone.
• Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold
- bulleted- list
• bulleted
• list
1. numbered2. list
1. numbered
2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in $$ ... $$ or $ ... $ to ensure proper formatting.
2 \times 3 $2 \times 3$
2^{34} $2^{34}$
a_{i-1} $a_{i-1}$
\frac{2}{3} $\frac{2}{3}$
\sqrt{2} $\sqrt{2}$
\sum_{i=1}^3 $\sum_{i=1}^3$
\sin \theta $\sin \theta$
\boxed{123} $\boxed{123}$

Sort by:

@Aryan Sanghi - Can you Python this? I will share the JavaScript code if you want.

- 1 month, 1 week ago

I'll try to python it. Don't worry, I don't need JavaScript code. :)

- 1 month, 1 week ago

K, awesome!

- 1 month, 1 week ago

'an embedded page in this page needs you to put a number between 3-8 in the second output box"

the message wont go away in it and i cant put any numbers to fulfill what it wants me to do

- 1 month, 1 week ago

Oh, ok I'll edit it, seemingly it didn't get saved when I removed that bug.

- 1 month, 1 week ago

thanks

- 1 month, 1 week ago

Try it now, it works :)

- 1 month, 1 week ago

ok will do

- 1 month, 1 week ago

yea its better now since there is a bigger delay between each message it now gives the user sufficient time to fix it before every tim i pressed ok so i could fix my number it kept spamming itself so thx for fixing it

- 1 month, 1 week ago

Thanks ;)

- 1 month, 1 week ago

pretty neat are you also gonna make a full calculator but with this system integrated? also how to do strikethru text and divide sign on computer

also is there any way i can help u guys with this like being a tester or something

- 1 month, 1 week ago

Thanks. I might make this a full calculator, but that will take time. The Latex for strike-through as far as i remember is \cancel{}, but I a maybe wrong, so check the latex guide of Marton's. What do you mean by you guys? This is a solo project(mostly because people treat JavaScript like a dead language as far as I know). If you mean Aryan Sanghi, then as I mentioned before, I was just interested in whether this could be recreated in Python. You can help me by suggesting ideas and finding bugs if you want to.

- 1 month, 1 week ago

- 1 month ago

I also fixed the bug of tangent. Tan 90 will usually get you a large number that goes out of the screen. That is kinda undefined, so I made a condition so that whenever these kind of numbers occur, it will just replace them with text saying 'Undefined'. Though it isn't completely fixed, as the undefined number flashes in and goes out, which still has to be fixed.

- 1 month, 1 week ago

ok i will test it to see if there is any glitches or bugs is there anything in particular u wanted me to test

- 1 month, 1 week ago