Message Boards Message Boards

0
|
5201 Views
|
3 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Get section of a sphere remaining after putting constraints?

Posted 6 years ago

Hi,

I want to find out the section of a sphere remaining after putting constraints in terms of cartesian planes. How it can be done ?

For example, if I have a sphere of r = 1, and I put the constraint z > 0 on it, simple imagination would suggest that it leaves half the sphere as defined by limits ? ? [0,?/2] and ? ? [0,2?]. Adding the constraint x > 0 leaves a quarter of the sphere with ? ? [0,?/2] and ? ? [0,?] and so on.

I want to achieve the same using Mathematica for more complex planes/constraints and find out the (?,?) limits for remaining portions of sphere.

Will appreciate any suggestions

thanks

POSTED BY: S G
3 Replies
Posted 6 years ago

One way to visualize

DiscretizeRegion[ImplicitRegion[x^2 + y^2 + z^2 <= 1, {x, y, z}]]

enter image description here

DiscretizeRegion[ImplicitRegion[x^2 + y^2 + z^2 <= 1 && z >= 0 && x >= 0, {x, y, z}]]

enter image description here

To determine ?, ? limits, just convert x, y, z ranges from cartesian to spherical coordinates. Can you give an example of "more complex planes / constraints"? You can use Solve to determine the intersection points / ranges for more complex situations. See this example.

POSTED BY: Rohit Namjoshi
Anonymous User
Anonymous User
Posted 6 years ago

Help: ref/ClipPlanesStyle works by planes, graphics 3D has other tricks too (include ones that operate on invisible object having textures on their surface)

Help ref/RegionFunction applies to plotting and exclusions

the best way to do what your thinking depends on what shapes and exclusions you ultimately want (be careful of what you ask for)

primarily, i would suggest reviewing Plot and Graphics3D to see which of the many features that do clipping, exclusions, and other things have the ultimate effect you seek

for example, if i said "use clipping" i would have no idea if "all of your specifications" might be possible

POSTED BY: Anonymous User
Posted 6 years ago

If you want to calculate the constraints for the angles you can do it this way:

cond1 = Sqrt[x^2 + y^2 + z^2] <= 1 && z > 0;
cond2 = Sqrt[x^2 + y^2 + z^2] <= 1 && x > 0 && z > 0;

If you replace x,y,z with there representation in spherical coordinates, you get conditions for r and some trigonometric expressions:

cond3 = Simplify[
  cond1 /. Thread[{x, y, z} -> 
     CoordinateTransform[
      "Spherical" -> "Cartesian", {r, \[Theta], \[Phi]}]], r > 0]

"Reduce" can be used to derive finally constraints for the angles themself:

Reduce[cond3 && 0 <= \[Theta] <= \[Pi], \[Theta]]

cond4 = Simplify[
  cond2 /. Thread[{x, y, z} -> 
     CoordinateTransform[
      "Spherical" -> "Cartesian", {r, \[Theta], \[Phi]}]], r > 0]

Reduce[cond4 && 0 <= \[Theta] <= \[Pi] && 
  0 <= \[Phi] <= 2 \[Pi], {\[Phi], \[Theta]}]

Using region functionalities you can easily compute the volumes and display the defined regions:

 reg1 = ImplicitRegion[cond1, {x, y, z}];
 reg2 = ImplicitRegion[cond2, {x, y, z}];

RegionMeasure can be used to compute the volume:

 {RegionMeasure[reg1, 3], RegionMeasure[reg2, 3]}

Region will display the defined regions:

  {Region[reg1], Region[reg2]}
POSTED BY: Michael Helmle
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract