We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Sumar and the Floating Rocks
Sumar and the Floating Rocks
Sort by
recency
|
54 Discussions
|
Please Login in order to post a comment
Equation of Line (y-y1)=(y2-y1)/(x2-x1) (x-x1)
=> y(x2-x1) - y1 (x2-x1) = x (y2-y1) - x1 (y2-y1)
=> y(x2-x1) - x (y2-y1) = - x1 (y2-y1) + y1 (x2-x1)
=> - x (y2-y1) + y(x2-x1) = - x1 (y2-y1) + y1 (x2-x1)
=> a=(x2-x1), b=(y2-y1)
as per the Extended Euclid Algorithm : for integral solution to this equation, the RHS should be multiple of gcd(a,b) i.e. gcd (|x2-x1| ,| y2-y1|)
This problem is very insightful and has a simple solution after working it out. Let. a/b = (y2 - y1)/(x2 - x1) be the slope in the reduced form. Sabexch Registration
can any one explain solution for me ?
I can't understand this solution. if y = x/2 + 1, so x should be from multiples of 2 then y be an integer. how gcd solve this problem ?