Hidden WordScanner
Private scans · No account required

DuckieDai Trig Tools

Four angle tools in one program: find coterminal angles, change degrees to radians, change a multiple of pi to degrees, and name an angle's quadrant and type.

trigonometry · MIT License

Overview

Four angle tools in one program: find coterminal angles, change degrees to radians, change a multiple of pi to degrees, and name an angle's quadrant and type.

  • Owner-tested on a TI calculator
  • Version 1.0.0
  • 2896 bytes
  • Uses math

Before you run it

  • TI-84 Plus CE Python · No calculator OS or Python App version has been verified.
  • TI Connect CE .py transfer to the Python App; the owner's transfer details were not recorded
  • Angles are measured from the positive x-axis, counterclockwise for positive angles.
  • For Angle/quad, the angle is first reduced to one turn, 0 up to 360 degrees, and the answer describes that angle.
  • Numbers may be typed as decimals or fractions such as 1/3; inf and nan are asked for again.

Try the DuckieDai calculator screen

Follow the program's prompts and result flow before downloading.

JavaScript is required for the optional browser simulation. Source viewing and downloading remain available without it.

Simulation boundary: This preview uses a reviewed browser adapter. It does not execute the downloaded Python and does not prove TI-Python or calculator compatibility.

Learn the math

How coterminal angles, radians, and quadrants work

The idea

An angle in standard position starts on the positive x-axis and turns, counterclockwise for a positive angle and clockwise for a negative one. Turning a full circle, 360 degrees or 2pi radians, lands you back where you began.

So angles that differ by whole turns end in the same place. They are called coterminal, and every angle has one between 0 and 360 degrees. Where an angle ends decides its quadrant, and that decides the signs of sine, cosine, and tangent.

The formula

coterminal angle = angle + 360k (k any whole number)

radians = degrees*pi/180

degrees = (multiple of pi)*180

360 or 2pi
one full turn, in degrees or radians
k
how many whole turns are added or taken away
Quadrant 1 to 4
the four regions between the axes, numbered counterclockwise from the top right

Using the program

Worked example

Find a positive and a negative angle coterminal with -30 degrees. Choose 1, then 1 for degrees, and enter -30.

-30 + 360 = 330, 330 - 360 = -30

The program shows Positive: 330.0 and Negative: -30.0.

For 17pi/6, choose 1, then 2, and type 17/6. Taking away one full turn, 12pi/6, leaves 5pi/6, so the program shows Positive: 5/6pi and Negative: -7/6pi.

Change 90 degrees to radians: choose 2 and enter 90. The program shows EXACT: 1/2 pi and DEC: 1.570796.

Where does 135 degrees end? Choose 4, then 1, and enter 135. The program shows Quadrant 2, Up-left, and Obtuse.

Tips and common mistakes

Where this comes up

Coterminal angles, radian measure, and quadrants open the trigonometry unit in precalculus and algebra 2, and they come back whenever the unit circle is used.

Exact reviewed bytes

Source code

Download .py

View source below, copy it when JavaScript is available, or download the exact .py bytes.

  1. # DUCKIEDAI TM - TRIG LITE
  2. # TI-84 CE PYTHON
  3. from math import pi
  4. def n(p):
  5. while 1:
  6. try:
  7. s=input(p)
  8. if '/' in s:
  9. a,b=s.split('/')
  10. v=float(a)/float(b)
  11. else:v=float(s)
  12. if v-v:raise ValueError
  13. return v
  14. except:
  15. print('Try again')
  16. def f(a,b):
  17. a=int(a);b=int(b)
  18. x=abs(a);y=abs(b)
  19. while y:x,y=y,x%y
  20. if x:a//=x;b//=x
  21. if b==1:return str(a)
  22. return str(a)+'/'+str(b)
  23. def pause():
  24. input("ENTER to continue")
  25. def intro():
  26. print('DUCKIEDAI(TM)')
  27. print('TRIG TOOLS')
  28. print(' __')
  29. print(' ___(o )> quack!')
  30. print(' \\ <_. )')
  31. print(" `---'")
  32. print('by DuckieDai')
  33. print('hiddenwordscanner.com')
  34. input('Press Enter ')
  35. print('\n'*7)
  36. def bye():
  37. print('DUCKIEDAI (TM)')
  38. print('hiddenwordscanner.com')
  39. input('ENTER to exit')
  40. def menu():
  41. while 1:
  42. print('\n'*8)
  43. print('DUCKIEDAI TM TRIG')
  44. print('1 Coterminal')
  45. print('2 Deg to rad')
  46. print('3 pi to deg')
  47. print('4 Angle/quad')
  48. print('0 Exit')
  49. k=input('Pick: ')
  50. if k=='0':break
  51. if k=='1':
  52. print('1 Deg 2 Pi 3 Rad')
  53. z=input('Angle type: ')
  54. if z=='1':
  55. a=n('Degrees: ')
  56. v=a%360
  57. print('Positive:',v if v else 360)
  58. print('Negative:',v-360 if v else -360)
  59. elif z=='2':
  60. try:
  61. s=input('Pi fraction (a/b): ')
  62. if '/' in s:
  63. x,y=s.split('/')
  64. a=int(x);b=int(y)
  65. else:
  66. a=int(s);b=1
  67. if b==0:raise ValueError
  68. if b<0:a=-a;b=-b
  69. v=a%(2*b);w=v-2*b
  70. if v==0:v=2*b
  71. print('Positive:',f(v,b)+'pi')
  72. print('Negative:',f(w,b)+'pi')
  73. except:
  74. print('Invalid fraction')
  75. elif z=='3':
  76. a=n('Radians: ')
  77. v=a%(2*pi)
  78. if abs(v)<1e-9 or abs(v-2*pi)<1e-9:v=0
  79. print('Positive:',round(v if v else 2*pi,6))
  80. print('Negative:',round(v-2*pi,6))
  81. else:print('Invalid type')
  82. elif k=='2':
  83. a=n('Degrees: ')
  84. if a==int(a):
  85. print('EXACT:',f(a,180),'pi')
  86. print('DEC:',round(a*pi/180,6))
  87. elif k=='3':
  88. print('Enter coefficient of pi')
  89. a=n('pi x: ')
  90. print('Degrees:',round(a*180,6))
  91. elif k=='4':
  92. print('1 Deg 2 Pi 3 Rad')
  93. z=input('Angle type: ')
  94. if z=='1':
  95. a=n('Degrees: ')%360
  96. elif z=='2':
  97. a=(n('Pi coefficient: ')*2)%4
  98. a=a*90
  99. elif z=='3':
  100. a=(n('Radians: ')%(2*pi))*180/pi
  101. else:
  102. print('Invalid type')
  103. pause()
  104. continue
  105. if abs(a-360)<1e-8:a=0
  106. if abs(a)<1e-8:print('+X axis')
  107. elif abs(a-90)<1e-8:print('+Y axis')
  108. elif abs(a-180)<1e-8:print('-X axis')
  109. elif abs(a-270)<1e-8:print('-Y axis')
  110. else:
  111. q=int(a//90)+1
  112. print('Quadrant',q)
  113. if q==1:print('Up-right')
  114. elif q==2:print('Up-left')
  115. elif q==3:print('Down-left')
  116. else:print('Down-right')
  117. if abs(a-90)<1e-8:print('Right')
  118. elif abs(a-180)<1e-8:print('Straight')
  119. elif abs(a)<1e-8:print('Zero/full')
  120. elif a<90:print('Acute')
  121. elif a<180:print('Obtuse')
  122. else:print('Reflex')
  123. else:print('Try 0-4')
  124. if k!='0':pause()
  125. intro()
  126. menu()
  127. bye()
Filename
TRIGMAIN.py
Size
2896 bytes
SHA-256
82f18c0baff941d55f24c7f51b184cbb074a62b44e431a4c389838c631b8ff79

Usage

Inputs

  • A menu choice: 1 coterminal angles, 2 degrees to radians, 3 a multiple of pi to degrees, 4 quadrant and angle type
  • An angle in degrees, as a fraction or multiple of pi, or in radians

Outputs

  • A positive and a negative coterminal angle in the same form as the input
  • Radians exactly in terms of pi and as a decimal, or degrees from a multiple of pi
  • The quadrant or axis of an angle, and whether it is acute, right, obtuse, straight, or reflex

Units: Angles in degrees, multiples of pi, or radians.

Assumptions and limitations

Assumptions

  • Angles are measured from the positive x-axis, counterclockwise for positive angles.
  • For Angle/quad, the angle is first reduced to one turn, 0 up to 360 degrees, and the answer describes that angle.

Constraints

  • Numbers may be typed as decimals or fractions such as 1/3; inf and nan are asked for again.
  • A pi fraction for coterminal angles must be whole numbers, such as 3/4 for 3pi/4.
  • Degrees to radians shows an exact answer in terms of pi only for whole-number degrees.

Known failures

  • Coterminal angles in degrees are not rounded, so 1/3 shows every digit Python prints.
  • Angles within about 0.00000001 degree of an axis are reported as on that axis.

Compatibility and review

Review status
Owner-tested on a TI calculator
Tested on
Owner reports personally running this program on a TI-84 Plus CE Python calculator; the test date, OS version, and Python App version were not recorded
What happened
Owner reported pass on the calculator before three fixes: the number prompt now asks again when inf or nan is typed, where the original stopped with an error, and a full turn now shows 2pi and 6.283185 as its negative coterminal angle in place of 0pi and 0.0. Every other step is unchanged; this exact file has not yet been rerun on a calculator.
Dependencies
math
Suggested calculator name
TRIGMAIN — you can give it another valid, unique name when you transfer it
Desktop test cases
Not available for this interactive-only source

This exact source auto-launches an interactive calculator session, so compatibility evidence comes from the recorded physical-device review rather than an importable desktop fixture.

Transfer and launch

Download the .py file, send it to your calculator with TI Connect CE as TRIGMAIN or another name, then open the Python App and try the worked example on this page first. This release has no verified calculator OS or Python App version; treat transfer and execution as unverified until independently tested.

Full installation and troubleshooting guide. Check your teacher's or exam's rules before using any program.

Version history

Did a DuckieDai program help with your homework? Every program here is free. If you would like to say thanks, you can leave a tip on Cash App ($duckiedai214) or read what tips pay for.

Independent compatibility resource: Hidden Word Scanner is independent and is not affiliated with or endorsed by Texas Instruments. TI product names describe compatibility only.

Action-count privacy: Successful downloads, preview starts, and preview completions increment same-origin aggregate counters, and so does a Yes or No answer about whether the program worked. Your browser notes that you answered; that note is never sent to the site. No entered values, source text, IP address, account, cookie, device identifier, or fingerprint is stored with these counts.