The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
December 2001



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


Java2D - How can i find the centre of any shape

Posted by vijay on December 26, 2001 at 2:23 AM


I have many shape objects. I need to find the centre of the shape object.

How do i find it. Is there any mathematical formula to do it.

I dont want the centre of the bounds of the shape !!

I can iterated thro the path of the shape and figure the representations

But i dont know how to find the centre of the shape.

Now if i have to pictorially show my problem - how do it do it in this forum.

I have a gif file - on looking in to it may be everyone will get a beter idea

Thanks in advance - need a solution very badly :-(



Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us