I am trying to find an area center of various types of rectagles.
(Center of gravity and midpoint of 4 ertices never work so please think in different way)
Please see this image: http://img22.imageshack.us/img22/7881/rectangles.jpg
I have to position of red dot
Point vertices[4]; Point areaCenter;

I have to find areaCenter so (nearly)
area(areaCenter, vertices[0], vertices[1]) = area(areaCenter, vertices[1], vertices[2]) =
area(areaCenter, vertices[2], vertices[3]) = area(areaCenter, vertices[3], vertices[0])

I tried many different ways to find the mid point but none of them covered every types of rectangles.

Can any1 give me some idea?

Recommended Answers

All 2 Replies

Please don't ask us to do your homework for you, and if it isn't homework/school work, but real work, there are well-known algorithms on the Internet that will help you. Try some Google and Wikipedia searches.

You're not looking for the area centre of a rectangle, because only one of your examples is actually a rectangle.

I think you're asking how to identify the point in a given four-sided shape that, when a line is drawn from that point to all corners, each of the four areas thus defined has the same numerical area value/ Is that right? This is known as Equidissection (http://en.wikipedia.org/wiki/Equidissection).

The first thing that springs to mind, which might even be quite fun to code and watch, is an iterative method involving an initial guess and subsequent refinements to that guess. It'd be miserable to do by hand, but a computer is ideally suited for such a method.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.