wood burning stoves 2.0*
The moose likes Applets and the fly likes java centre point (x,y) of line Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "java centre point (x,y) of line" Watch "java centre point (x,y) of line" New topic

java centre point (x,y) of line

rajiv jackz

Joined: Jul 12, 2010
Posts: 29
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
rajiv jackz

Joined: Jul 12, 2010
Posts: 29
above mid point formula was not working

please anyone help me out here???

i need mathematical formula ???
Paul Clapham

Joined: Oct 14, 2005
Posts: 18541

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.
I agree. Here's the link: http://aspose.com/file-tools
subject: java centre point (x,y) of line
Similar Threads
drawing arrows
Drawing a Diamond Shape (like Rectangle, Circle)
Calculating the distance between two points problem
Moving Shapes between two Points
Simple Math Question