2
$\begingroup$

I want to plot the following set in Mathematica:

$$\{ (x_1, x_2)/x_3 \mid (x_1-3)^2 + (x_2-3)^2 + (x_3 - 3)^2 \leq 1\}.$$

In other words, this set is the output of applying the perspective function $f(x_1, x_2,x_3) = (x_1,x_2)/x_3$ to each point of the unit sphere centered at $(3,3,3)$ (note that on this sphere $x_3 >0$ so division by zero is not an issue). Is there a way of plot this set in Mathematica? Any help will be much appreciated.

$\endgroup$

1 Answer 1

3
$\begingroup$

Method-1

ParametricRegion[{{x1, x2}/x3, (x1 - 3)^2 + (x2 - 3)^2 + (x3 - 3)^2 <=
     1}, {x1, x2, x3}] // Region

enter image description here

RegionPlot[
 DiscretizeRegion[
  ParametricRegion[{{x1, x2}/
     x3, (x1 - 3)^2 + (x2 - 3)^2 + (x3 - 3)^2 <= 1}, {x1, x2, x3}], 
  AccuracyGoal -> 3], BoundaryStyle -> Red]

enter image description here

Method-2

plot = RegionPlot3D[
   ImplicitRegion[(x1 - 3)^2 + (x2 - 3)^2 + (x3 - 3)^2 <= 1, {x1, x2, 
     x3}], PlotRange -> All, PlotPoints -> 80, 
   ViewProjection -> "Orthographic"];
Graphics[plot[[1, 1]] /. {x_Real, y_Real, z_Real} -> {x, y}/z]

enter image description here

$\endgroup$
3
  • $\begingroup$ That is great, thanks so much! $\endgroup$
    – TDH
    Mar 17, 2023 at 8:00
  • $\begingroup$ Quick question @cvgmt : is there a way to show the boundary along with the region? $\endgroup$
    – TDH
    Mar 17, 2023 at 8:22
  • $\begingroup$ Great, thank you very much! $\endgroup$
    – TDH
    Mar 17, 2023 at 8:42

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.