Reduction of an Angle

Description

by Dr. D.G. Simpson, http://www.pgccphy.net/1030/software.html

This program reduces a given angle to the range [0; 360) in degrees mode, or [0; 2π) in radians mode. It will work correctly whether the calculator is set for degrees or radians mode.
To run the program:

θ f A

The program will return the equivalent reduced angle.

Example:
Let θ = 5000° and set the calculator’s angle mode to degrees. Enter the above program, then type:

5000 f A

The program returns 320°.

Program Resources

Labels

Name Description
 A Main program
 0 For angles >= 0

Storage Registers

Name Description
.0 Angle of full circle, i.e. 360° or 2π
.1 Stores the initial value

Program

Line Display Key Sequence Line Display Key Sequence
000 019 20 ×
001 42,21,11 f LBL A 020 45 .1 RCL . 1
002 44 .1 STO . 1 021 40 +
003 1 1 022 43 32 g RTN
004 16 CHS 023 42,21, 0 f LBL 0
005 43 24 g COS⁻¹ 024 45 .0 RCL . 0
006 2 2 025 34 x↔y
007 20 × 026 43,30, 8 g TEST x<y
008 44 .0 STO . 0 027 43 32 g RTN
009 45 .1 RCL . 1 028 34 x↔y
010 43,30, 3 g TEST x≥0 029 10 ÷
011 22 0 GTO 0 030 43 44 g INT
012 45 .0 RCL . 0 031 45 .0 RCL . 0
013 10 ÷ 032 20 ×
014 16 CHS 033 45 .1 RCL . 1
015 43 44 g INT 034 34 x↔y
016 1 1 035 30
017 40 + 036 43 32 g RTN
018 45 .0 RCL . 0