Problem 57750. Radius of an inner N-dimensional sphere

• Created by HH
A hypercube is an N-dimensional analogue of a square (N=2). Similarly, an N-sphere is an N-dimensional analogue of a circle. Note that a circle is considered a 1-sphere set in 2D space. In this problem, we will consider a circle as having a dimensionality of 2, a sphere as 3, and so on.
We begin by considering a square (2D hypercube) of length 2R centered around the origin of a 2D Cartesian plane. Four circles (2D 1-spheres) of radius R are placed, such that each one is centered around one of the square's corners. Each circle is tangent to its two neighers. In the illustration below, the square is represented by the gray area and the four circles are displayed in blue.
An additional inner circle or radius r, displayed in red, is centered around the origin, such that it is tangent to all other circles. Your task is to compute this radius.
In 3D, there would be a cube of length 2R, with eight spheres centered on the cube's corneres and an inner sphere centered around the origin. This continues similarly in higher dimensions.
Given the number of dimensions, N, and the radius of the corner N-spheres, R, return the radius of the inner N-sphere, r. Round your answer to 3 decimal places.
Example:
N = 2;
R = 1;
r = 0.414
This example represents the 2D case, as illustrated above, in which the radius of the corner circles is equal to 1.

Solution Stats

100.0% Correct | 0.0% Incorrect
Last Solution submitted on Apr 25, 2024

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!