0% found this document useful (0 votes)
11 views17 pages

Khan Academy - Javascript

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views17 pages

Khan Academy - Javascript

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Khan

Academy
Javascript:
y = mx + b
Table of contents

01 Cracking the Code

02 Number’s Don’t Lie!


(Calculations)
03 Expanding Horizons:
Extensions

04 Navigating Obstacles: Struggle


& Triumph
01

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

Numbers Don’t Lie


(Calculations)
Rough Work to Verify the
Code
To verify whether the code works or not,
we found the equation of the line of the
same coordinates by manually
calculating the slope and y-intercept.
They match with the code, so therefore,
the code works!
03

Expanding
Horizons:
Extensions
Adding Something New

Challenge A: At first, it was a


challenge to have the value of m be in
fraction form. To do so, we calculated
the rise and run separate.

Challenge B: While the slope was in


C
fraction now, we still had to learn to th alcu
em la
simplify the fraction. In real life, that se ting
pe
would mean dividing both numbers ra
te
by the GCF of both numbers.
The curly brackets are used to
define a block of code that is
executed as a single unit.
Another Extra
Parallel & Perpendicular Lines

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

● We got the slope to simplify! (learned something new)


● We got the slope in fraction form!
● Our code is organized!
Thanks for
having the
patience to sit
through!

You might also like