Re: [algogeeks] Best method to choose a quadrant

2010-06-16 Thread Anand
Here is a simple Implementation for it. http://codepad.org/6TPw3txq On Tue, Jun 15, 2010 at 6:06 AM, Anurag Sharma wrote: > just check the signs of the i, j components of vector from the centre of > screen to (x,y) > > pseudo code:- > getQuadrant(x,y){ >string Q[]={"1st","4th","2nd", "3rd"};

Re: [algogeeks] Best method to choose a quadrant

2010-06-15 Thread Anurag Sharma
just check the signs of the i, j components of vector from the centre of screen to (x,y) pseudo code:- getQuadrant(x,y){ string Q[]={"1st","4th","2nd", "3rd"}; vx=(x>=midx)?0:1 vy=(y>=midy)?0:1 return Q[(vx<<1)|vy] } Anurag Sharma On Mon, Jun 14, 2010 at 5:55 PM, siddharth srivastav

Re: [algogeeks] Best method to choose a quadrant

2010-06-15 Thread Debajyoti Sarma
Don't understand the question. explain differently. On 6/14/10, siddharth srivastava wrote: > I have this code snippet: > This code snippet defines a boundary coordinates on the screen wrt to the > center(of the screen). > > if( x < x_center ) > x_border = x_center - x_shift; > el

[algogeeks] Best method to choose a quadrant

2010-06-15 Thread siddharth srivastava
I have this code snippet: This code snippet defines a boundary coordinates on the screen wrt to the center(of the screen). if( x < x_center ) x_border = x_center - x_shift; else x_border = x_center + x_shift; if( y < y_center ) y_border = y_center - y_shift;