# java centre point (x,y) of line

rajiv jackz

Greenhorn

Posts: 29

posted 6 years ago

java code or formula to find centre point (x,y) of line??

actually i used mid point formula x1,y1

x2,y2 then

i used (x1+x2)/2

(y1+y2)/2

actually i used mid point formula x1,y1

x2,y2 then

i used (x1+x2)/2

(y1+y2)/2

rajiv jackz

Greenhorn

Posts: 29

posted 6 years ago

You have the right formula, provided that (x1, y1) and (x2, y2) were actually the end-points of the line. Perhaps they weren't... we certainly can't determine that by looking at your post. Also read this: ItDoesntWorkIsUseless and then post something which would help us to help you better.