(71B) Sign "Graph" of Trig Functions
|
12-06-2020, 03:52 PM
Post: #1
|
|||
|
|||
(71B) Sign "Graph" of Trig Functions
http://edspi31415.blogspot.com/2020/12/h...tions.html
Introduction The program SGNTRIG builds a 22 character binary string that depends on the function: g(x) = 1 if sgn(t(x/c)) > 1 0 if sgn(t(x/c)) ≤ 0 where: c is a scaling factor, sgn(x) is the sign function, and t(x) represents one of three trigonometric functions, sin(x), cos(x), or tan(x). Angles are assumed to be radians. If we set to scale to c = 1, then g(x) takes the integer values from 1 to 22. The HP 71B builds the result to the string S$. This is an aid to visualize at least some of the graph. When the bit is 1, the graph is above the x-axis, otherwise, the graph is either on or below the x-axis. The program presented can be expanded or modified to explore other functions. The resulting string is a "psuedo-graph". Below is a graphical representation of g(x) (an HP Prime is used to graph g(x)). [HP Prime of g(x)] HP 71B Program SGNTRIG Size: 270 bytes Code:
Notes: Line 105: creates a blank string, which is allowed on the HP 71B Line 125: The KEY$ function calls for a key input. S for sine, C for cosine, and T for tangent. Lines 205 to 215: determine which trigonometric function to use Line 220: Sets the character to 0 if the sign function returns 0 or -1 Line 225: &, the ampersand symbol concatenates two strings Lines 230 and 240, respectively: 589 Hz is middle D, 661 Hz is middle E |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
(71B) Sign "Graph" of Trig Functions - Eddie W. Shore - 12-06-2020 03:52 PM
RE: (71B) Sign "Graph" of Trig Functions - C.Ret - 01-11-2021, 02:29 PM
RE: (71B) Sign "Graph" of Trig Functions - Eddie W. Shore - 01-12-2021, 03:57 AM
|
User(s) browsing this thread: 1 Guest(s)