(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 |
|||
01-11-2021, 02:29 PM
(This post was last modified: 01-12-2021 06:56 AM by C.Ret.)
Post: #2
|
|||
|
|||
RE: (71B) Sign "Graph" of Trig Functions
Hello !
It really surprise me, why using binary text representation, whereas the HP-71B is a really perfect Graphic Calculator ?! I liberally simplify your code using built-in instructions only. The result is a much better field of curve explorations and freedom. No more limited to sin cos tan or sgn function’s now. Code:
Fill free to continue testing any SGN(SIN(X)) as well ! Enjoy it ! Images Sharing: https://drive.google.com/file/d/1pDTHSA6...sp=sharing https://drive.google.com/file/d/1pGSwbJm...sp=sharing |
|||
01-12-2021, 03:57 AM
Post: #3
|
|||
|
|||
RE: (71B) Sign "Graph" of Trig Functions
Incredible! Thank you for sharing!
|
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)