HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Python Labs
  2. /Solving trigonometric equations
MathematicsMediumHigh School (9–10)Trigonometry › Trigonometric Functions and Graphs

Solving trigonometric equations

You will solve sin⁡x=k\sin x = ksinx=k, cos⁡x=k\cos x = kcosx=k and tan⁡x=k\tan x = ktanx=k for 0∘≤x≤360∘0^\circ \le x \le 360^\circ0∘≤x≤360∘ with a list of candidate angles. The function keep is given: it keeps the angles in range, rounds them to 111 decimal place, removes repeats and sorts them.

Your tasks.

  1. In solve_sin, return [] if ∣k∣>1|k| > 1∣k∣>1. Otherwise let a be math.degrees(math.asin(k)) and pass the candidates a, 180 - a and the same angles plus or minus 360 to keep.
  2. In solve_cos, do the same with a = math.degrees(math.acos(k)) and the candidates a and 360 - a, with a shift of 360.
  3. In solve_tan, use a = math.degrees(math.atan(k)) and the candidates a, a + 180 and a + 360.

Run it first, just as it is. The checker at the end prints FAIL for each task. Then do the tasks one at a time, and run the program again after each one. A Hint appears under every check that still fails.

When every line says PASS, try solve_sin(0.8) and compare the two angles with the symmetry of the sine curve.

StemPy LabContributed by StemPy Lab
python
Loading Python runtime…

A worked solution

Have you tried it?

Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.

Log in to save
← All Labs
← Moving particlesNext →
More onTrigonometry › Trigonometric Functions and Graphs

Discussion (0)

Log in to join the discussion.

Loading…

Learn it in

  1. Graphs of sine, cosine and tangentVectors in Two Dimensions and Trigonometric Graphs

More labs on this topic

  1. Read a wave from its equationMedium
  2. Which quadrant?Easy
  3. Sectors and segments in radiansMedium
  4. Finding roots by a scanMedium
The simplification rules as codeMedium
All labs on this topic →