Board logo

標題: [已解決] 急問Turbo C++(Geometry - two-point form)高手快來!!! [打印本頁]

作者: bid_real    時間: 2007-10-9 21:01     標題: 急問Turbo C++(Geometry - two-point form)高手快來!!!

我想問呢題
According to the two-point form, a general equation of a straight line “y=mx+c” can be formed if two coordinates are given. Write a C program, it will accept two coordinates then find out the general equation.

(y-y1)/(x-x1)=(y2-y1)/(x2-x1)



Example:

Input coordinates for A(x1,y1) B(x2,y2):2 5 6 8
A(2,5) B(6,8)
The equation of two point is y=0.75x+3.5

有冇人知點做?Thanks so much!

[ 本帖最後由 bid_real 於 2007-10-10 01:15 編輯 ]




歡迎光臨 香港 Xocat Forum 討論區 (http://p.xocat.com/p/) Powered by Discuz! 6.0.0