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$
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$
  • 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$ – Chip Hurst Sep 25 '16 at 1:55
  • $\begingroup$ Ah, this clears it up, thanks. $\endgroup$ – Mike Sep 25 '16 at 2:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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