數理應用 1.4 交線

// find the point of intersection between two lines 點斜式,兩直線不平行

float *lineIntersect (float *L1point, float LiSlope, float *L2point, float L2Slope)

{

float temp[2] = {0, 0};

//solve for our x value if the solution ///????

temp[0] = (L1Slope *L1point[0] - L2Slope * L2point[0] + L2point[1] - L1point[1] / (L1Slope - L2Slope);

temp[1] - L1slope(temp[0] - L1point[0]) + L1point[1];

return temp;

}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章