Last active
November 27, 2015 16:47
-
-
Save gusennan/c98dfb664effce04d77d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(1a) | |
//takes in two "points" (arrays of doubles), and returns an array of doubles that contains | |
//the slope and the y intercept of the line between the two points | |
double * line(double * pt1, double * pt2){ | |
double xTmp, yTmp; | |
xTmp = (pt2[1]-pt1[1])/(pt2[0]-pt1[0]); | |
yTmp = pt1[1] - xTmp*pt1[0]; | |
pt1[0] = xTmp; | |
pt1[1] = yTmp; | |
return pt1; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment