MatDeck software example to create graph of trigonometric functions sine and cosine on [-2π, 2π] segment and place them on the same graph.
Create new document by pressing the New icon , press Maths icon and select a place on the document where you wish to place it. A new canvas object will appear with a Maths object inside it. Now create the new variable a:=curve2d, this code will create the new variable a and store results of function curve2d in it. .
Function curve2d will always be used when we want to draw a graph, it is a function that creates a matrix of two columns and the number of rows can be determined in the fifth argument. Simply put, the first argument is the function that we want to draw with preferred symbols or values as arguments, the second argument is the symbol which we are going to change with numerical values, third and fourth are numerical intervals of values that correspond to the second argument. The fifth argument is the number of samples. In the first empty node type sin to create new sine function , then type symbol x as its argument. In the second node type symbol x, in third type -2*cpi (this is a standard way of inserting constants π in to the document, every constant has a character c in front of it), in the next node type 2*cpi and in the last node type 100 for example.
From the Place tab select Graph icon , select a place on the canvas where you want to place it, a new graph object will appear. From the right mouse click select the content menu and press Add variable option, now choose variable a that we created earlier. A sine function graph will appear.
Let us create another variable b:=curve2d. In the first empty node, type cos to create new cosine function and type the symbol x as its argument. In the second node type symbol x, in the third node type -2*cpi, in the next node type 2*cpi and in the last node type 100for example. From the right mouse button click select the content menu and press Add variable option, now choose variable b that we have just created. A cosine function graph will appear.