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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:12:19+00:00 2026-05-25T16:12:19+00:00

Suppose we have been given the coordinates of the centre of a solid rectangular

  • 0

Suppose we have been given the coordinates of the centre of a solid rectangular box, the box’s length, breadth, height and a solid ball with a given centre and radius.

Is there a fast way to check if the box is a subset of the ball? The only simple method that comes to my mind is to check if each of the 8 corner vertices lies inside the sphere. If yes, the box is indeed a subset of the ball (by convexity property of the ball).

  • 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-05-25T16:12:19+00:00Added an answer on May 25, 2026 at 4:12 pm

    If you expect that most of the time the box will not be inside the sphere, you can do some quick tests:

    if (sphere.center.x+sphere.radius<box.center.x-box.size.x) return false;
    if (sphere.center.x-sphere.radius>box.center.x+box.size.x) return false;
    etc.
    

    If you expect that the box will usually be far inside the sphere, you can do other quick tests:

    bsx = box.size.x;
    bsy = box.size.y;
    bsz = box.size.z;
    box_radius = sqrt(bsx*bsx+bsy*bsy+bsz*bsz)/2;
    brx = box.center.x-sphere.center.x;
    bry = box.center.y-sphere.center.y;
    brz = box.center.z-sphere.center.z;
    box_dist = sqrt(brx*brx+bry*bry+brz*brz);
    if (box_radius+box_dist<sphere.radius) return true;
    

    You will still need more precise tests if the quick tests fail though.

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

Sidebar

Related Questions

I have been given a staff list which is supposed to be up to
I suppose similar problem would have been discussed here, but I couldn't find it.
Suppose I have: Toby Tiny Tory Tily Is there an algorithm that can easily
Suppose I have a table called Companies that has a DepartmentID column. There's also
I've seen second one in another's code and I suppose this length comparison have
I Have been given this simple task , I have this list where i
I have been given a w2k3 server today that is running IIS 6. This
I have been given a large PHP project that I am supposed to fix
I was given this bit of Scheme code, and have been tasked with translating
I am very new to iPhone development, but I have been given an iPhone

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.