# Find the right angle of a shot (SNOOKER)

**URL:** <https://community.wolfram.com/t/find-the-right-angle-of-a-shot-snooker/15060>\
**Category:** Questions\
**Tags:** physics, graphics-and-visualization, interface-construction, modeling\
**Created:** [November 29, 2019, 4:55pm UTC](https://community.wolfram.com/t/find-the-right-angle-of-a-shot-snooker/15060 "2019-11-29T16:55:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hdolhaine](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/hdolhaine/32/35924_2.png) [@hdolhaine](https://community.wolfram.com/u/hdolhaine)\
**Post date:** [November 29, 2019, 4:55pm UTC](https://community.wolfram.com/t/find-the-right-angle-of-a-shot-snooker/15060/1 "2019-11-29T16:55:36Z")

</div>

Snooker is a fascinating sport. Just now the UK Championship is taking place.

I tried to visualize (in a 1st approximation, things are a bit more complicated in real life) how the cue ball covers an object ball when a certain angle is needed.

Look at the follwoing code. The left side of the resulting graphics shows the situation and the angle necessary to kick the opject-ball in the pocket, the right side shows the view from the cue ball to the object-ball for this shot.

Now I tried to make the right side of this graphic bigger (that does not work by increasing the r in the Sphere-statements), but without success. It seems that Manipulate renders a frame which could not be modified (at least in my version Mma 7). If you click on the right side of the picture that frame appears. As you see there is ample space above and below the spheres.

Is there a method to get rid of that space above and below the spheres? I tried PlotRange, ImageSize, ContentSize and many others, but nothing worked.

```
tT = {2, 2};
tT3 = {2, 2, 0};
r = .35;
gh = -2 r tT/Norm[tT];
obb = {0, 0};
dd = 3.;
gh3 = -2 r tT3/Norm[tT3];
obb3 = {0, 0, 0};

Manipulate[
 phi = phi1 Pi/180;
 cue = dd {Cos[3 Pi/4 + phi], Sin[3 Pi/4 + phi]};
 tTp = tT - gh;
 obbp = obb - gh;
 ghp = gh - gh;
 cuep = cue - gh;
 cue3 = dd {Cos[3 Pi/4 + phi], Sin[3 Pi/4 + phi], 0};
 tTp3 = tT3 - gh3;
 obb3p = obb3 - gh3;
 ghp3 = gh3 - gh3;
 cue3p = cue3 - gh3;
 vp = 10 cue3p/Norm[cuep];
 xx = Norm[cue3p - obb3p];
 GraphicsGrid[
  {{Graphics[
     {Red, Disk[obbp, r], Black, Circle[ghp, r], GrayLevel[.8], 
      Disk[cuep, r],
      Black, Line[{cuep, ghp, tTp}], Dashed, Circle[tTp, 2 r]}, 
     PlotRange -> {{-3, 3}, {-3, 3}}],
    Graphics3D[{White, Sphere[cue3p, r], Red, Sphere[obb3p, r], 
      Black}, ViewPoint -> vp, Boxed -> False, 
     SphericalRegion -> True]}},
  ImageSize -> Large
  ], {phi1, 20, 160}]

```

Hints are appreciated.

---

<div class="post-metadata">

**Author:** ![hdolhaine](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/hdolhaine/32/35924_2.png) [@hdolhaine](https://community.wolfram.com/u/hdolhaine)\
**Post date:** [November 30, 2019, 1:11am UTC](https://community.wolfram.com/t/find-the-right-angle-of-a-shot-snooker/15060/2 "2019-11-30T01:11:31Z")

</div>

This is perhaps somewaht better, but the original problem remains.

```
r = .2;
d = 1.5;
f = 1.2;
obb = {0, 0, 0};
obb2 = {0, 0};
ghb = {0, -2 r, 0};
ghb2 = {0, -2 r};

Manipulate[
 phi = (270 + w) Pi/180;
 cue = d {Cos[phi], Sin[phi], 0};
 cue2 = Take[cue, 2];
 vp = ghb + (cue - ghb) 10;
 
 g1 = Graphics[
   {Red, Disk[obb2, r],
    GrayLevel[.8], Disk[cue2, r],
    Black, Circle[ghb2, r],
    Black,
    Line[{cue2, obb2}],
    Arrow[{obb2, {0, 1}}],
    Arrow[{cue2, ghb2}],
    Dashed, Line[{ghb2, obb2}]
    },
   PlotRange -> {f {-d, d}, f {-d, d}}
   ];
 
 g2 = Graphics3D[
   {
    Red, Sphere[obb, r],
    White, Sphere[cue, r]
    },
   ViewPoint -> vp,
   Boxed -> False,
   SphericalRegion -> True
   ];
 
 GraphicsGrid[{{g1, g2}}, ImageSize -> Large],
 {w, {-70, -60, -45, -30, 0, 30, 45, 60, 70}}, ControlType -> Setter]

```

---

<div class="post-metadata">

**Author:** ![hansmilton](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/hansmilton/32/8656_2.png) [@hansmilton](https://community.wolfram.com/u/hansmilton)\
**Post date:** [November 30, 2019, 8:40am UTC](https://community.wolfram.com/t/find-the-right-angle-of-a-shot-snooker/15060/3 "2019-11-30T08:40:17Z")

</div>

You could use the option `ViewAngle`

```
g2 = Graphics3D[
	{Red, Sphere[obb, r], White, Sphere[cue, r]},
	ViewPoint -> vp, Boxed -> False, SphericalRegion -> True,
	ViewAngle -> 2.2 \[Degree]
];

```

---

<div class="post-metadata">

**Author:** ![henrikschachner](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/henrikschachner/32/32119_2.png) [@henrikschachner](https://community.wolfram.com/u/henrikschachner)\
**Post date:** [November 30, 2019, 12:49pm UTC](https://community.wolfram.com/t/find-the-right-angle-of-a-shot-snooker/15060/4 "2019-11-30T12:49:55Z")

</div>

Dear Hans,

I guess this effect comes from the fact that the whole box (visible or not) is displayed. You can see this when you change in `g2` the option to `Boxed -> True`. I do not have a clean solution for this. A sort of cropping would be necessary, consequently a “quick and dirty” way would be:

```
g2 = ImageCrop@
   Rasterize[Graphics3D[{Red, Sphere[obb, r], White, Sphere[cue, r],
      Gray, PointSize[.005], Point[{{0, 0, -.4}, {0, 0, .4}}]}, 
     ViewPoint -> vp, Boxed -> False, SphericalRegion -> True], 
    ImageResolution -> 200];

```

The points above and below are necessary to avoid rescaling.

Best regards – Henrik
