You are on page 1of 6

Sayre, Cyrell M.

ESC 311

BSCS-3, Section 62 November 03, 2022

Graphing Linear Equations

1. Draw the graph of each equation in R.


2. In the graph, find the coordinates of the point of intersection of the 3 graphs.
The coordinates are (29, -2, -3)
3. Solve the linear equations using matrices and compare your answer to the intersection of the
graph in #2.
The coordinates of the point of intersection of the 3 graphs are (29, -2, -3) while the values I got in
solving those linear equations using matrices are (3, -2, 1)
Code in number 1

a.

install.packages("scatterplot3d");
library("scatterplot3d");

x <- c(2,0,0)
y <- c(0,2,0)
z <- c(0,0,2)

scatterplot3d(x, y, z, main=" Graphing Linear Equation x+y+z=2", type="o", lwd=2)

b.

install.packages("scatterplot3d");
library("scatterplot3d");

x <- c(5.2,0,0)
y <- c(0,-7.75,0)
z <- c(0,0,6.2)

scatterplot3d(x, y, z, main=" Graphing Linear Equation 6x-4y+5z=31", type="o", lwd=2)

c.

install.packages("scatterplot3d");
library("scatterplot3d");

x <- c(2.6,0,0)
y <- c(0,6.5,0)
z <- c(0,0,6.5)

scatterplot3d(x, y, z, main=" Graphing Linear Equation 5x+2y+2z=13", type="o", lwd=2)


Code in Number 2

You might also like