I have rather simple task and I would like to ask you for recommendation. I hope there is a Java library which can help me.
Description
Given
- GSM cell with longitude, latitude, azimuth, max and min distance. With the help of these parameters I can describe a sector (a part of circle)
- longitude, latitude and a radious of an object.
Meaning
Each GSM cell consists of several sectors (they start from one point). Each object is represented as a circle (longitude, latitude, radius). A circle can
- touch one sector
- intercept one sector
- intercept several sectors of a given GSM cell
Task:
I get a list of GSM cells and an object. I need to find all iterceptions/touches of an object with some sectors. I need to order by resulting list of interceptions by square of interception.
Look like typical math/geometry task. Is there any library in Java which can help me?
So here is my solution.
We deciced that “center” of 2D projection should be relative. It does fit our task.
Here are some code samples:
Here is a builder for Geometry figures:
I should mention that TURN_LEFT is specific. Angles of my object starts at 12 o’clock. Geometry library starts to count from 3 o’clock. That it why I have to turn it 3 hours (90 degrees) back.
The problem is solved.
I’ve also used LiteShape to draw some images to PNG file. Everythng is ok.