shylaja23
BAN USER
Questions (1)
Comments (4)
Reputation 40
- 0of 4 votes
AnswersWrite a method in your preferred language that given an array of n points on a plane specified by their (x,y) coordinates, and an angular size α, returns the direction β at which a beam of size α centered at the origin of the coordinate system would enclose the most number of points from the array. The direction of the beam can be represented by an angle β as shown in the illustration below.
- shylaja23 in United States
Tip: The function arctan(y/x) returns the angle of a point.
In the illustration below, the blue dots represent points from the array and the grey beam represents the beam of size α pointed in a direction β where it happens to enclose three points.| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
This is exactly what I thought and here is the implementation of this idea in Visual Basic.
- shylaja23 July 14, 2013