[algogeeks] Re: geometry problem

2007-06-18 Thread Ramaswamy R
On 6/14/07, Monu Rathour <[EMAIL PROTECTED]> wrote: > > There are some rectangles and some pin-vertices's in a two dimensional > plane. I have to join pin-vertices's such that lines are rectilinear and > line should not cross over the rectangles. > > How to write a mathematical formula for calc

[algogeeks] Re: geometry problem

2007-06-15 Thread monu
Please anyone help me.. On 6/15/07, monu <[EMAIL PROTECTED]> wrote: > > I am given the co-ordinates of rectangles and pin-vertices's as ( Xi, > Yi ) where i lies b/w 1 to n. Now i have to write formula in terms of ( Xi, > Yi ) . > > Please help me > > On 6/15/07, Victor Carvalho <[EMAIL

[algogeeks] Re: geometry problem

2007-06-14 Thread monu
I am given the co-ordinates of rectangles and pin-vertices's as ( Xi, Yi ) where i lies b/w 1 to n. Now i have to write formula in terms of ( Xi, Yi ) . Please help me On 6/15/07, Victor Carvalho <[EMAIL PROTECTED]> wrote: > > I know how to do a easier variation of this problem, is not

[algogeeks] Re: geometry problem

2007-06-14 Thread Victor Carvalho
I know how to do a easier variation of this problem, is not a simple problem, I think I can help you only with a start point... :) 1) Do you perceive that I can firstly calculate the shortest distance between 2 points based on lines and the rectangle edges, ok? You take all the paths with all ar

[algogeeks] Re: geometry problem

2007-06-14 Thread monu
Please anyone help me.. On 6/14/07, Monu Rathour <[EMAIL PROTECTED]> wrote: > > There are some rectangles and some pin-vertices's in a two dimensional > plane. I have to join pin-vertices's such that lines are rectilinear and > line should not cross over the rectangles. > > How

[algogeeks] Re: Geometry Problem.

2007-02-22 Thread Limin Fu
Right, by splitting ( O(log(N)) ) the polygon into two chains at two extremes can avoid removing vertexes. Actually following this idea, I found a simpler algorithm: 1. Take arbitrary 3 vertexes (say A,B,C) that can split the polygon into 3 more or less equally sized chains. These 3 vertexes for

[algogeeks] Re: Geometry Problem.

2007-02-20 Thread frkstyc
I think a sequence of vertices in (counter)clockwise order with constant time access by index will well suffice. Below I assume the counterclockwise order, which I prefer in most cases. My approach is to first split the polygon into two chains of vertices at two extremes with respect to the direc

[algogeeks] Re: Geometry Problem.

2007-02-19 Thread Limin Fu
I agree with you, it not correct to say it does not take O(N) time. I mainly wanted to point out the factor that in the mentioned algorithm to remove some vertexes there is no need to iterate on the vertexes. To get a real O(log(N)) algorithm for the problem, probably it can be done with another

[algogeeks] Re: Geometry Problem.

2007-02-16 Thread W Karas
On Feb 16, 4:23 am, "Limin Fu" <[EMAIL PROTECTED]> wrote: > Hi, > It does not take O(N) time to remove these vertexes, if you store them > in an array allocated in a continuous memory. It only need to copy a > block of memory without iterating on the vertexes. In order to determine the time compl

[algogeeks] Re: Geometry Problem.

2007-02-16 Thread Limin Fu
Hi, It does not take O(N) time to remove these vertexes, if you store them in an array allocated in a continuous memory. It only need to copy a block of memory without iterating on the vertexes. On 2月15日, 下午1时52分, "Shayan Ehsani" <[EMAIL PROTECTED]> wrote: > Hi > > What do you mean "remove vertex

[algogeeks] Re: Geometry Problem.

2007-02-15 Thread Shayan Ehsani
Hi What do you mean "remove vertexes between A and B from the vertex list and repeat(1); " It takes O(N) too remove these vertexes.Can you explain more? Thanks. On 2/14/07, Limin Fu <[EMAIL PROTECTED]> wrote: > > > Hi, > > If the vertexes are sorted in clockwise or the reverse order, there is

[algogeeks] Re: Geometry Problem.

2007-02-14 Thread Limin Fu
Hi, If the vertexes are sorted in clockwise or the reverse order, there is a simple algorithm to find the instersection points in O(log(N)) time. This algorithm works similarily as binary searching. That is: (1) starting from the first vertex (A) in the vertexes list, and take another vertex (B)