CHAPTER 8: LINEAR EQUATIONS - BASIC GRAPHING WITH SAGE
HACCdg/SPRING 2011
Worksheet: Section 8.3. Question Type 1: How to plot a given point or ordered pair in SAGE
Plot the point or ordered pair (-2,-5)
|
|
How to plot more than one point at a time
|
|
#8.3 Question Type 2: Determine if (1,2) is a solution of x - y = 4
Method 1: We separately evaluate the two sides and then compare:
|
|
|
Method 2: Let SAGE do the evaluation.
Another way to do this is to type in the equation and let SAGE itself deside whether the equation evaluates to "True" or to "False"
False False |
The only thing about Method 2 is we just know it is "False" but SAGE doesn't tell us what L and R are. Now solve the other parts of the worksheet just below. Try to include enough comments to explain what you're doing as I have done here. Use the pound # sign to let SAGE know those are just comments.
#8.3 Question Type 3: Complete each ordered pair so that it is a solution of the given equation
Given Equation: x+2y=6 Ordered Pair to complete: (2,_)
Here we know x=2 but y=unknown # We can use the given equation to solve for y!
[y == 2] [y == 2] |
|
|
In 8.4, we are told to complete the table. We can use the above method since the table is just composed of three ordered pairs or points!
[y == 1] [y == 1] |
[x == 0] [x == 0] |
[y == -3] [y == -3] |
Now we plot all three points
|
|
|
|
|
|
Using any two points above, we can actually draw the line through those three points.
This is how we tell SAGE to draw a line given two endpoints!
[y == x - 2] [y == x - 2] |
Another method to draw a line without using the tables. SAGE needs to know just the equation!
The three-point method above was just for us to be able to get a quick idea how the equation translates into a line.
|
|
|
|
|
|
|
|
|
|
[A == 90] [A == 90] |
|
|
[P == (50/3)] [P == (50/3)] |
16.6666666666667 16.6666666666667 |
|
|
|
|
ENJOY! THE END
For future reference, commands used in this lesson are found in: http://www.sagemath.org/doc/reference/sage/plot/plot.html?highlight=linear%20plot
We only need the basic use of each command.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|