# 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 A Former Brilliant Member
7 months, 3 weeks 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. numbered
2. 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 1

paragraph 2

paragraph 1

paragraph 2

> 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:

@Krishna Karthik - That 'oofmation animation' dude needs a brain...this is what he posted -

that it. You what more huh? I don't' care if I have bad grammar, I am very happy for who I am and, how about this, I will take about puberty I am not scared to talk about that. laughs

The douchebag doesn't know we've talked about much worse ;)

lol Did you see his new note? He posted one about puberty, and it got taken down, so he posted another one being butthurt about it lol - oof butthurt

- 5 months, 4 weeks ago

I literally can't believe it; I really think either he's lying about his age or he's not right. In the case that he's not right, I think I should just ignore it.

By the way he told me he has Grammarly 🤣🤣🤣. Yup, I know how ridiculous that sounds. If he keeps making spam content, I would consider reporting his profile.

- 5 months, 4 weeks ago

He's probably lying bout his age to show off...I can't believe that dude has Grammarly?!?!?! What a waste...lol

- 5 months, 4 weeks ago

I think his name is quite accurate, he's the type of guy you walk past and think "Oof" in your head 🤣

- 5 months, 4 weeks ago

@Krishna Karthik - lol yeah

- 5 months, 4 weeks ago

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

- 7 months, 3 weeks ago

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

- 7 months, 3 weeks ago

K, awesome!

- 7 months, 3 weeks 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

- 7 months, 3 weeks ago

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

- 7 months, 3 weeks ago

thanks

- 7 months, 3 weeks ago

Try it now, it works :)

- 7 months, 3 weeks ago

ok will do

- 7 months, 3 weeks 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

- 7 months, 3 weeks ago

Thanks ;)

- 7 months, 3 weeks 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

- 7 months, 3 weeks 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.

- 7 months, 3 weeks ago

- 7 months, 3 weeks 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.

- 7 months, 3 weeks 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

- 7 months, 3 weeks ago

Great job!

- 6 months, 1 week ago

Thank you!

- 6 months, 1 week ago

So. Anything exciting happen while I took a small holiday from Brilliant?

- 6 months ago

Not much...other than my solutions and upvotes rocketing to 100-200 in the Daily Challenges :)

I'm glad you're back tho :)

Hey, this looks pretty good for a grade 8er!

- 6 months ago

Thanks bro :)

Hullo

- 5 months, 4 weeks ago

Hey @NSCS 747 do you know that OOFMATION guy?

- 5 months, 4 weeks ago

@Percy Jackson Actually, I've seen Nathan around Oofmation's posts recently, so I think he knows about Oofmation.

But yeah, Nathan's a pretty nice guy, so I suppose he's more tolerating than others. He is willing to look past the fact that Oofmation is a creationist and quite egotistical.

- 5 months, 4 weeks ago

Yeah

- 5 months, 4 weeks ago

: )

- 3 months, 3 weeks ago

What are you smiling at?

- 3 months, 3 weeks ago

: )

- 3 months, 3 weeks ago

lol

- 3 months, 3 weeks ago

@NSCS 747 Hey bro, how are you doing?

- 5 months, 4 weeks ago

good good how bout u

- 3 months, 3 weeks ago

2 months ago...

- 3 months, 3 weeks ago

i realised better lat e then never

- 3 months, 3 weeks ago

Ahaha thanks for responding nevertheless :)

- 3 months, 3 weeks ago

anything intersting happen while i was offline? i saw srijan pop up in my email notifs

- 3 months, 3 weeks ago

lol @NSCS 747 @Krishna Karthik

Nothing much interesting happened...just the rickroll on BM

- 3 months, 3 weeks ago

what was bm's reaction

- 3 months, 3 weeks ago

he posted a funny ryan reynolds gif lol

- 3 months, 3 weeks ago

srijan is dead in my notifs...he's inactive i guess

- 3 months, 3 weeks ago

Haha yeah; I haven't seen Srijan around that much either. And I've been a bit inactive too the past few weeks, not gonna lie.

- 3 months, 3 weeks ago

yea i was inactive last few months, just became active in the last week or so

- 3 months, 3 weeks ago

Last time I was fairly active in brilliant was when I made my N-body simulation.

- 3 months, 3 weeks ago