trigonometry · MIT License
Overview
Find the quadrant and the reference angle of any angle, in degrees or as a fraction of pi, including the coterminal angle between 0 and 2pi.
- Owner-tested on a TI calculator
- Version 1.0.0
- 1894 bytes
- No imports
Tried it? Did this program work on your calculator?
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
- An angle in degrees can be any number, such as -150 or 37.5.
- A pi angle is typed as a whole-number numerator and denominator, such as 17 and 12 for 17pi/12.
- Whole numbers only for a pi numerator and denominator; the denominator cannot be 0.
Try the DuckieDai calculator screen
Follow the program's prompts and result flow before downloading.
TI-84 Plus CE Python · screen preview
Learn the math
How to find the quadrant and reference angle of any angle
The idea
Every angle, however large or negative, ends in one of the four quadrants or on an axis. Adding or taking away full turns does not change where it ends, so the first step is to bring the angle between 0 and 360 degrees, or 0 and 2pi.
The reference angle is the acute angle between where the angle ends and the x-axis. It is the angle you look up in the special triangles; the quadrant then tells you each sign.
The formula
coterminal: add or take away 360 degrees, or 2pi, until 0 <= angle < 360
reference angle: Q I t, Q II 180 - t, Q III t - 180, Q IV 360 - t
in pi: Q I t, Q II pi - t, Q III t - pi, Q IV 2pi - t
Q I to Q IV- the four quadrants, numbered counterclockwise from the top right
coterminal angle- an angle that ends in the same place after whole turns
ON AXIS- an angle that ends on an axis, such as 90 or pi, which is in no quadrant
Using the program
- Choose 1 for an angle in degrees and type it, such as -150 or 37.5.
- Choose 2 for an angle with pi: type the number in front of pi, then the number under it, so 17pi/12 is 17 and 12.
- The program shows the quadrant and the reference angle; for a pi angle it first shows the coterminal angle between 0 and 2pi.
- Press Enter to go back to the menu, and choose 3 to exit.
Worked example
Find the reference angle of -150 degrees. Choose 1 and type -150. Adding 360 gives 210, which is in Quadrant 3.
210 - 180 = 30
The program shows Q III REF: 30 deg.
Find the reference angle of 17pi/12. Choose 2 and type 17, then 12. 17pi/12 is between pi and 3pi/2, so it is in Quadrant 3, and 17pi/12 - pi = 5pi/12. The program shows COTERM: 17pi/12 and Q III REF: 5pi/12.
Try -7pi/4: type -7 and 4. Adding 2pi gives pi/4, in Quadrant 1. The program shows COTERM: pi/4 and Q I REF: pi/4.
Tips and common mistakes
- The reference angle is never negative and never more than 90 degrees, or pi/2. If yours is, recheck the quadrant.
- Measure the reference angle to the x-axis, not the y-axis. In Quadrant 2, 120 degrees has a reference angle of 60, not 30.
- For a pi angle, compare the numerator with the denominator: 17pi/12 is more than 12pi/12 = pi and less than 18pi/12 = 3pi/2.
- Angles on an axis have no reference angle; the program shows ON AXIS.
Where this comes up
Reference angles open the unit circle unit of precalculus and trigonometry, and every later exact-value and graphing question relies on them.
Exact reviewed bytes
Source code
# DuckieDai(TM) Reference Angles# TI-84 Plus CE Pythondef gcd(a,b):a=abs(a);b=abs(b)while b:a,b=b,a%breturn adef fmt(x):r=round(x,6)return str(int(r)) if r==int(r) else str(r)def inp(p):while 1:try:return int(input(p))except ValueError:print('Whole number please')def show(n,d):if n==0:return '0'g=gcd(n,d);n//=g;d//=gif d==1:return 'pi' if n==1 else str(n)+'pi'return ('pi' if n==1 else str(n)+'pi')+'/'+str(d)def ref(a,full,half):# a is normalized to one revolutionif a==0 or a==half or a==full//2 or a==full-half:return 0,'AXIS'if a<half:return a,'I'if a<full//2:return full//2-a,'II'if a<full-half:return a-full//2,'III'return full-a,'IV'def main():print('DuckieDai(TM)')print('REFERENCE ANGLES')print(' __(o )>')print('hiddenwordscanner.com')while 1:print('1 Degrees 2 Pi fraction')print('3 Exit')c=input('Choice? ').strip()if c=='3':breakif c=='1':while 1:try:v=float(input('Angle degrees? '))if v-v==0:breakexcept ValueError:passprint('Number please')a=v%360if a in (0,90,180,270):print('ON AXIS')elif a<90:print('Q I REF:',fmt(a),'deg')elif a<180:print('Q II REF:',fmt(180-a),'deg')elif a<270:print('Q III REF:',fmt(a-180),'deg')else:print('Q IV REF:',fmt(360-a),'deg')elif c=='2':n=inp('Pi numerator? ')d=inp('Pi denominator? ')if d==0:print('Denominator cannot be 0')else:if d<0:n=-n;d=-da=n%(2*d)print('COTERM:',show(a,d))# Avoid floats: work in half-pi units with doubled numeratorx=2*aif x in (0,d,2*d,3*d):print('ON AXIS')elif x<d:print('Q I REF:',show(a,d))elif x<2*d:print('Q II REF:',show(d-a,d))elif x<3*d:print('Q III REF:',show(a-d,d))else:print('Q IV REF:',show(2*d-a,d))else:print('Choose 1, 2, or 3')input('Enter to continue ')print('\n'*5)main()
- Filename
REFANGLE.py- Size
- 1894 bytes
- SHA-256
ba824348a34543bc762fc1f532d781560d3d06fd62b74458ba07a1665bad2d79
Usage
Inputs
- A menu choice: 1 degrees, 2 pi fraction, 3 exit
- An angle in degrees, or a pi numerator and denominator
Outputs
- The quadrant, Q I to Q IV, and the reference angle, or ON AXIS
- For a pi angle, the coterminal angle between 0 and 2pi first
Units: Degrees, or multiples of pi.
Assumptions and limitations
Assumptions
- An angle in degrees can be any number, such as -150 or 37.5.
- A pi angle is typed as a whole-number numerator and denominator, such as 17 and 12 for 17pi/12.
Constraints
- Whole numbers only for a pi numerator and denominator; the denominator cannot be 0.
- inf and nan are asked for again.
Known failures
- Degree answers are rounded to 6 decimal places.
- An angle that ends on an axis shows ON AXIS, with no reference angle.
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 for the owner's original. For publication the opening screen adds hiddenwordscanner.com, inf and nan are asked for again instead of giving nan, a degree answer such as 30.0 shows as 30, and a menu choice may have spaces around it. This exact file has not yet been rerun on a calculator.
- Dependencies
- No imports
- Suggested calculator name
REFANGLE— 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 REFANGLE 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
- 1.0.0 — current version, published . Download this reviewed version
Related learning
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.