Can someone please help me. I understand the equation of the line and how to solve for zero interception on paper, but I have problems converting it to code. In particular, I need to calculate the point at which the 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, it CalcLineYInterceptreturns the X coordinate of the point where the line intercepts yintercept(not necessarily zero). I have problems converting algebraic equations into code (and yes, I understand that C ++ is an algebraic language, but the code itself is not simple and isolates variables). Is there an easy way to do this?
Many thanks
source
share