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):[u]2 5 6 8[/u]
A(2,5) B(6,8)
The equation of two point is y=0.75x+3.5
有冇人知點做?Thanks so much!
[[i] 本帖最後由 bid_real 於 2007-10-10 01:15 編輯 [/i]]