Khan Academy - Javascript
Khan Academy - Javascript
Academy
Javascript:
y = mx + b
Table of contents
Cracking the
Code
Here’s What Our Code
Does
We chose to create a code that
calculates the equation of a line
passing through two given points.
The points are represented by their x
and y coordinates (x1, y1) and (x2,
y2). In this case, those points are
(-10, -8) and (7, 26). The code first
calculates the slope of the line using
the formula (y2 - y1) / (x2 - x1) and
then goes to find the value of b by
isolating b in y = mx +b.
02
Expanding
Horizons:
Extensions
Adding Something New
We also went on to find the equations of the lines parallel and perpendicular to the
original.
04
Navigating
Obstacles: Struggle &
Triumph
Struggles
● We had to tweak the code to calculate the rise and run separately
for the value of m (slope)\
● Tried Standard Form - didn’t work
● It was a struggle to simplify the fractions
Things We’re Proud Of