Can someone please help me. I understand the equation of a line and how to solve for the zero intercept on paper, but I have trouble converting it to code. More specifically, I need to calculate the point at which a line intercepts any given X or Y coordinate with two different functions...
double CalcLineYIntercept(LINE *line, double yintercept) { }
double CalcLineXIntercept(LINE *line, double xintercept) { }
So, CalcLineYIntercept
would return the X coordinate of the point where the line intercepts yintercept
(not necessarily zero). I have trouble converting algebraic equations to code (and yes I understand that C++ is an algebraic language, but the code itself does not simply and isolate variables). Is there a simple way to accomplish this?
Thank you very much