Sign in to follow this  
Spirytus

point on a sphere

Recommended Posts

Some time ago I had similar question on the exam and was wonder if someone could show me how to solve it. Its too late now as exam is gone but i would really like to know how to solve it so any help would be much appreciated. For a sphere of radius 5 and centre at (2, 0, 3), which one of the following points is not on the surface? (5, 0, 7) (7, 0, 5) (6, 0, 6) (4, 2, 7.123)

Share this post


Link to post
Share on other sites
I assume past homework questions are ok, and this could certainly be game-related, so... A sphere with center C and radius r can be represented by the equation:
|X-C| = r
X-C is the vector you get by subtracting the point C from the point X, and |...| means length. A useful equivalent form is:
|X-C|2 = r2
Which squares both sides thereby avoiding the square root. Any point X that satisfies either equation (remember they are equivalent) is on the surface of the sphere. Another useful expression is:
|X-C|2 <= r2
Which represents all points on the surface of and inside the sphere. Note that this is all pretty much an elaboration on Xai's answer.

Share this post


Link to post
Share on other sites
Here's my take :

Initial conditions : You have a sphere centered on the point (2, 0, 3), of radius 5.

Theoretical data : Canonical equation of a sphere is
sqrt( (x - cx)^2 + (y - cy)^2 + (z - cz)^2 )= r, where
cx is the x value of the center of the sphere
cy is the y value of the center of the sphere
cz is the z value of the center of the sphere
r is the radius of the sphere

Equivalently, we can use a 'simpler' formula by squaring both sides:
(x - cx)^2 + (y - cy)^2 + (z - cz)^2 = r^2

Application : Substituting into the equation with our known values, with
cx = 2
cy = 0
cz = 3
r = 5,
we obtain the following equation for our particular sphere:
(x - 2)^2 + y^2 + (z - 3)^2 = 25

Then, you can just fill in with every value in the list of points.

Practical validation : I whipped up a sample Python program to make sure it worked.
## Sphere surface belonging test

points = [[5,0,7], [7,0,5], [6, 0, 6], [4, 2, 7.123]]

## Loop thru every points
for p in points:
## calculate if the squared distance from the center is
## around 25
distance = (p[0]-2)*(p[0]-2) + p[1]*p[1] + (p[2]-3)*(p[2]-3)
if( not (distance < 25.1 and distance > 24.9 )):
## Print it to the user if so
print str(p) + " isn't in the circle."



Results :
[7, 0, 5] isn't in the circle.

There you have it, following my university's problem solving method. ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this