20 January 2014

Quick Procedure for Calculating Reference Angles

Near the beginning of my 11th grade of high school, in Mr. Hopkins's Trigonometry/ Analytic Geometry class, I noticed that the reference angle of an angle measure like 200° is 20°, and it is the same as the reference angle of 2 million degrees and 200 million degrees and 2 trillion degrees, and so on.  I also noticed that it was similarly easy to find the reference angle of any degree angle measure that is a positive integer power of ten multiplied by 200°, 400°, 600°, or 800°.  Probably within a couple of weeks, I had developed a procedure (more of a programming solution than a mathematical one) for finding the reference angle of any degree angle measure with only addition, subtraction, loops, table-lookups and conditionals.  The simplest procedure with a calculator that I know is to divide the angle measure by 180°, then take the remainder and multiply it by 180°.  If it is greater than 90°, then subtract it from 180°.  Whether or not you have to perform that subtraction, the result is the reference angle of the angle measure.  Here is my procedure, which is far different.  I know, it doesn't look very polished.


digit      table(digit)
------     ------
 0          0
 1          -80
 2          20
 3          -60
 4          40
 5          -40
 6          60
 7          -20
 8          80
 9          -0


To find the reference angle measure in degrees (ref), start with the leftmost digit (digit) of the degree angle measure (measure).  While you are working with a digit in the hundreds place or greater, look up digit on the above table (table) and add the value to a temporary variable (temp) that starts with the value zero.  Continue adding to temp the remaining values corresponding to the digits in the hundreds place and greater.  When the tens place is reached, add the remaining amount of measure without looking up on table.  Set measure to the absolute value of temp, in degrees.  If measure is greater than or equal to 90°, repeat the procedure again.  If not, ref is measure.  The following is the procedure, but made more concise.


measure = given value in degrees
temp = 0
loop number of times equal to number of hundreds place or greater digits
  temp = temp + table(digit)
temp = temp + remaining digits
measure = absolute value of temp in degrees
if measure is greater than 90°, perform procedure again using new value of measure
ref is measure


Examples:
  ref(200°)
    measure = 200°
    temp = 0
    temp = temp + table(2) , which is 20
    temp = temp + (remaining digits , which is 00) , which is 20
    measure = abs(temp) in degrees , which is 20°
    is measure > 90° ? , which is no
    ref = measure , which is 20°


  ref(2200°)
    measure = 2200°
    temp = 0
    temp = temp + table(2) , which is 20
    temp = temp + table(2) , which is 40
    temp = temp + (remaining digits , which is 00) , which is 40
    measure = abs(temp) in degrees , which is 40°
    is measure > 90° ? , which is no
    ref = measure , which is 40°


  ref(3200°)
    measure = 3200°
    temp = 0
    temp = temp + table(3) , which is -60
    temp = temp + table(2) , which is -40
    temp = temp + (remaining digits , which is 00) , which is -40
    measure = abs(temp) in degrees , which is 40°
    is measure > 90° ? , which is no
    ref = measure , which is 40°


  ref(3090°)
    measure = 3090°
    temp = 0
    temp = temp + table(3) , which is -60
    temp = temp + table(0) , which is -60
    temp = temp + (remaining digits , which is 90) , which is 30
    measure = abs(temp) in degrees , which is 30°
    is measure > 90° ? , which is no
    ref = measure , which is 30°


  ref(3001°)
    measure = 3001°
    temp = 0
    temp = temp + table(3) , which is -60
    temp = temp + table(0) , which is -60
    temp = temp + (remaining digits, which is 01) , which is -59
    measure = abs(temp) in degrees , which is 59°
    is measure > 90° ? , which is no
    ref = measure , which is 59°


  ref(88888800°)
    measure = 88888800°
    temp = 0
    temp = temp + table(8) , which is 80
    temp = temp + table(8) , which is 160
    temp = temp + table(8) , which is 240
    temp = temp + table(8) , which is 320
    temp = temp + table(8) , which is 400
    temp = temp + table(8) , which is 480
    temp = temp + (remaining digits , which is 00) , which is 480
    measure = abs(temp) in degrees , which is 480°
    is measure > 90° ? , which is yes
    temp = 0
    temp = temp + table(4) , which is 40
    temp = temp + (remaining digits , which is 80) , which is 120
    measure = abs(temp) in degrees , which is 120°
    is measure > 90° ? , which is yes
    temp = 0
    temp = temp + table(1) , which is -80
    temp = temp + (remaining digits , which is 20) , which is -60
    measure = abs(temp) in degrees , which is 60°
    is measure > 90° ? , which is no
    ref = measure , which is 60°


If you notice any errors, please tell me of them.

No comments: