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 7983087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:51:23+00:00 2026-06-04T10:51:23+00:00

I get a point in the 2-D plane (x,y) as input. Now I have

  • 0

I get a point in the 2-D plane (x,y) as input. Now I have to check which quadrant it is in, do some Reflections about X-axis and Y-axis and check again which quadrant it is in repeatedly for a large number of times.

I have two approaches but not sure which is better

  1. I can store initially the x,y as boolean and then do boolean operations when Reflecting and hence this will be easy. To tell which quadrant the point is in just check the value is true or false.
  2. Or I can do the normal approach with int and then check the first bit to find which quadrant the point is in
  • 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-04T10:51:25+00:00Added an answer on June 4, 2026 at 10:51 am

    Neither, just compare your coordinates to 0.

    If you store them as boolean, besides losing information, you’ll probably get some overhead because of the conversion.

    If you check the first bit, it will be less readable.

    The compiler will optimize these calls on its own, doubt you’ll gain anything from a different approach.

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

Sidebar

Related Questions

I'm developing against a DB2 database, and at some point I get an error
Why do I get a CS5001: does not have an entry point defined error
I'll get straight to the point. I'm building a website on an existing database,
I'll get right to the point. This is what a browser request looks like
Can anyone point me in the direction of how I could get a NUnit
How to get coordinates of a point in a coordinate system when all I
I need to get the distance from a lat/lng point to a line. Of
I want to get the color of the Pixel at a specific Touch Point
Is there any way to get the local end point of a connected Silverlight
Is it possible to get position inside the OpenLayers container from a lat/long point?

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.