Question: State the following algorithm in plain english and provide the psuedo code of the following problem. Figure 1: An input instance for a problem in

State the following algorithm in plain english and provide the psuedo code of the following problem. State the following algorithm in plain english and provide the psuedo code

Figure 1: An input instance for a problem in Question 3 with n=6 half-lines. Each half-line is represted by a vector V[i] pointing (from the origin (0,0) ) in the direction of the half-line. In this instance, the given point (x,y) lies in the 5th region, so the algorithm should return 5 on this instance. 3. You are given n half-lines starting at an origin in R2. The half-lines are represented by an array V[1..n] of 2-dimensional vectors. More specifically, entry V[i] is a pair of numbers (ai,bi)R2 describing the ith half-line as consisting of all the points in the direction (ai,bi); that is, {(ait,bit):t0}. The half-lines in V[1..n] are sorted clock-wise. Note that the n half-lines partition the entire plane into n conical regions, which we number as follows: the conical region between the nth half-line and the 1st half-line is region 1 ; the conical region between the ith half-line and the (i+1)st half-line is region i+1 for i{1,2,,n1}. See Figure 1. In addition to the array of half-lines you are given a point (x,y)R2\{(0,0)}. Give an O(logn) algorithm that returns the name (index) of the conical region to which the point (x,y) belongs. If (x,y) lies exactly on some half-line, the algorithm should return the name (index) of the half-line on which (x,y) lies. Figure 1: An input instance for a problem in Question 3 with n=6 half-lines. Each half-line is represted by a vector V[i] pointing (from the origin (0,0) ) in the direction of the half-line. In this instance, the given point (x,y) lies in the 5th region, so the algorithm should return 5 on this instance. 3. You are given n half-lines starting at an origin in R2. The half-lines are represented by an array V[1..n] of 2-dimensional vectors. More specifically, entry V[i] is a pair of numbers (ai,bi)R2 describing the ith half-line as consisting of all the points in the direction (ai,bi); that is, {(ait,bit):t0}. The half-lines in V[1..n] are sorted clock-wise. Note that the n half-lines partition the entire plane into n conical regions, which we number as follows: the conical region between the nth half-line and the 1st half-line is region 1 ; the conical region between the ith half-line and the (i+1)st half-line is region i+1 for i{1,2,,n1}. See Figure 1. In addition to the array of half-lines you are given a point (x,y)R2\{(0,0)}. Give an O(logn) algorithm that returns the name (index) of the conical region to which the point (x,y) belongs. If (x,y) lies exactly on some half-line, the algorithm should return the name (index) of the half-line on which (x,y) lies

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!