Skip to content

Instantly share code, notes, and snippets.

@jweather
Created April 7, 2016 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jweather/a9e615014768c7b645f9f4291e468c40 to your computer and use it in GitHub Desktop.
Save jweather/a9e615014768c7b645f9f4291e468c40 to your computer and use it in GitHub Desktop.
xA = ((Y[1]-Y[0])*(X[0]-X[2]) + (Y[2]-Y[0])*(X[1]-X[0]))/((X[0]-X[2])*(X[1]*X[1]-X[0]*X[0]) + (X[1]-X[0])*(X[2]*X[2]-X[0]*X[0]));
xB = ((Y[1] - Y[0]) - xA*(X[1]*X[1] - X[0]*X[0])) / (X[1]-X[0]);
xC = Y[0] - xA*X[0]*X[0] - xB*X[0];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment