6
$\begingroup$

Mathematica returns

False

when I execute

Element[{0, 0, 0}, Sphere[{0, 0, 0}]]

whereas

 Element[{0, 0, 0}, Cuboid[]]

returns True as expected. Any clue why this could be happening?

$\endgroup$

1 Answer 1

10
$\begingroup$

Sphere is a two-dimensional object:

RegionDimension[Sphere[{0, 0, 0}]]
(* 2 *)

so its center is not included in the defined region. Only the shell is considered:

Element[Normalize@{1, 1, 1}, Sphere[{0, 0, 0}]]
(* True *)

You can use Ball instead:

RegionDimension[Ball[{0, 0, 0}]]
(* 3 *)

Element[{0, 0, 0}, Ball[{0, 0, 0}]]
(* True *)
$\endgroup$
2
  • 3
    $\begingroup$ (+1) Another way to see sphere is not a solid is In[102]:= Refine[RegionMember[Sphere[], {x, y, z}], Element[{x,y,z}, Reals]] Out[102]= x^2 + y^2 + z^2 == 1 $\endgroup$
    – Greg Hurst
    Sep 25, 2016 at 1:55
  • $\begingroup$ Ah, this clears it up, thanks. $\endgroup$
    – Mike
    Sep 25, 2016 at 2:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.