Post Reply 
function graphing
08-25-2023, 10:30 PM (This post was last modified: 08-25-2023 10:31 PM by Quadratica.)
Post: #1
function graphing
I have defined a function in CAS: angle(x,a)=(a*tan(x+a))+(a-sin(a*x))

I input x and a and it gives the expected answer.

is there a way to directly graph angle(x,2) or angle(x,-1) etc without manually changing 'a' in the definition of angle(x,a) ? changing 'a' in the definition is tedious if I want to plot several graphs for different 'a' .
Find all posts by this user
Quote this message in a reply
08-26-2023, 09:53 AM
Post: #2
RE: function graphing
One way to graph equations in CAS home is to use plotfunc command.

For your sample equation (a*tan(x+a))+(a-sin(a*x)),
you can type in plotfunc((a*tan(x+a))+(a-sin(a*x))|a=-1) etc. It will show a small graph in CAS home. if you select the graph and then touch the Show soft menu then a full-screen graph will be shown.
You can double tap on plotfunc((a*tan(x+a))+(a-sin(a*x))|a=-1) to copy on to the command line then press esc key and then modify just the a= to another value and plot another graph.
Altenatively, use this simple program called pfn.
       
[code]
#cas
// Using plotfunc command to plot a function
// in CAS home
pfn(a):=
BEGIN
plotfunc((a*tan(x+a))+(a-sin(a*x)))
END;
#end

Using above program you can simply type pfn(-1) etc
Find all posts by this user
Quote this message in a reply
08-26-2023, 11:23 AM (This post was last modified: 08-26-2023 11:25 AM by BruceH.)
Post: #3
RE: function graphing
You can use the 'where' function (the vertical bar symbol - |) to assign a temporary value to a variable in an expression.

For example, in the Function app in degrees mode:
  • F1(X)=SIN(X+a)|a=45
  • F2(X)=SIN(X+a)|a=0
show the effect in the graph.

Note that the variable 'a' needs to have been created before you can use it in a where value.
Find all posts by this user
Quote this message in a reply
08-26-2023, 05:25 PM
Post: #4
RE: function graphing
Thanks for those two suggestions, both worked like a treat !
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)