Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9256351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:55:12+00:00 2026-06-18T11:55:12+00:00

I have rather simple task and I would like to ask you for recommendation.

  • 0

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

  1. 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)
  2. 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

  1. touch one sector
  2. intercept one sector
  3. 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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T11:55:13+00:00Added an answer on June 18, 2026 at 11:55 am

    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:

    public final class GeometryUtil {
        /**
            https://www.cfa.harvard.edu/~dfabricant/huchra/ay145/constants.html
            1 Earth Radius = 6.37814x108 cm = 6.37814x10^6 m (Equatorial)
         */
        public static final double EARTH_RADIUS_IN_METERS = 6.37814e+6;
    
        private GeometryUtil(){}
    
        /**
         * @param geoPoint is a point of some object you want to translate to Cartesian.
         * @param geoPointRelative is a point of relative center.
         *                         We suppose that this relative GeoPoint is a center for the first parameter.
         * */
        public static Coordinate toCoordinate(GeoPoint geoPoint, GeoPoint geoPointRelative){
            return new Coordinate(toX(geoPoint, geoPointRelative.getLongitude()),
                                  toY(geoPoint, geoPointRelative.getLatitude()));
        }
    
        public static double toX(GeoPoint geoPoint, double relativeLongitude){
            return  EARTH_RADIUS_IN_METERS *
                    cos(toRadians(geoPoint.getLatitude()))  *
                    toRadians(geoPoint.getLongitude()- relativeLongitude);
        }
    
        public static double toY(GeoPoint geoPoint, double relativeLatitude){
            return  EARTH_RADIUS_IN_METERS * toRadians(geoPoint.getLatitude() - relativeLatitude);
        }
    
    }
    

    Here is a builder for Geometry figures:

    public final class GeometryBuilder {
    
        private static final int DIAMETER_MULTIPLIER = 2;
        private static final int TURN_LEFT = 90;    //We should start to roll to the right from "North"/"Up"/12 o'clock
    
        private GeometryBuilder(){}
    
    
        public static Circle buildCirlce(GeoPoint centerOfCircle, GeoPoint relativeCenter, Distance radiusDistance){
            GeometricShapeFactory geometricShapeFactory = new GeometricShapeFactory();
            geometricShapeFactory.setCentre(GeometryUtil.toCoordinate(centerOfCircle, relativeCenter));
            geometricShapeFactory.setSize(radiusDistance.getMeters() * DIAMETER_MULTIPLIER);
            return new Circle(geometricShapeFactory.createEllipse());
        }
    
    
         public static Sector buildGSMCellSector(GSMCellLocation gsmCellLocation, GeoPoint relativeCenter){
            GeometricShapeFactory geometricShapeFactory = new GeometricShapeFactory();
            geometricShapeFactory.setCentre(GeometryUtil.toCoordinate(gsmCellLocation.getGeoPoint(), relativeCenter));
            geometricShapeFactory.setSize(gsmCellLocation.getMidDist() * DIAMETER_MULTIPLIER);
            return new Sector(geometricShapeFactory.createArcPolygon(-toRadians(gsmCellLocation.getEndAngle()- TURN_LEFT),
                                                                      toRadians(gsmCellLocation.getAngleWidth())));
        }
    }
    

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a rather large text corpus, of which I would like to check
Have a rather simple question. Does anyone knows if i can use jparallax both
I have what I expect would be a pretty common task, but I can't
I have a rather simple task, retrieving an image file from a virtual folder
I have a rather simple ListView row: <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=wrap_content
I have a rather simple question that I could normally debug myself, but I
I have following rather simple query select count(*) from tbl t1, tbl t2 For
my question is rather simple, if you have an pure virtual class (interface) but
I will try to keep this as simple as possible. I have a rather
I'm rather new to WPF, so maybe this is a simple question. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.