pooltool.objects.cue#

Overview#

Classes#

Cue

A cue stick

CueSpecs

Cue stick specifications

Classes#

class pooltool.objects.cue.Cue(id: str = 'cue_stick', V0: float = 2.0, phi: float = 0.0, theta: float = 0.0, a: float = 0.0, b: float = 0.25, cue_ball_id: str = 'cue', specs: CueSpecs = CueSpecs.default)[source]#

A cue stick

id#

An ID for the cue.

Type:

str

V0#

The impact speed.

Units are m/s.

Warning: This is the speed of the cue stick upon impact, not the speed of the ball upon impact.

Type:

float

phi#

The directional strike angle.

The horizontal direction of the cue’s orientation relative to the table layout. Specified in degrees.

If you imagine facing from the head rail (where the cue is positioned for a break shot) towards the foot rail (where the balls are racked),

  • \(\phi = 0\) corresponds to striking the cue ball to the right

  • \(\phi = 90\) corresponds to striking the cue ball towards the foot rail

  • \(\phi = 180\) corresponds to striking the cue ball to the left

  • \(\phi = 270\) corresponds to striking the cue ball towards the head rail

  • \(\phi = 360\) corresponds to striking the cue ball to the right

Type:

float

theta#

The cue inclination angle.

The vertical angle of the cue stick relative to the table surface. Specified in degrees.

  • \(\theta = 0\) corresponds to striking the cue ball parallel with the table (no massé)

  • \(\theta = 90\) corresponds to striking the cue ball downwards into the table (max massé)

Type:

float

a#

The amount and direction of side spin.

  • \(a = -1\) is the rightmost side of ball

  • \(a = +1\) is the leftmost side of the ball

Type:

float

b#

The amount of top/bottom spin.

  • \(b = -1\) is the bottom-most side of the ball

  • \(b = +1\) is the top-most side of the ball

Type:

float

cue_ball_id#

The ball ID of the ball being cued.

Type:

str

specs#

The cue specs.

Type:

pooltool.objects.cue.datatypes.CueSpecs

Methods:

copy() Cue[source]#

Create a copy

Note

specs is shared between self and the copy, but that’s ok because it’s frozen and has no mutable attributes.

Return type:

Cue

reset_state() None[source]#

Resets V0, phi, theta, a and b to their defaults.

set_state(V0: float | None = None, phi: float | None = None, theta: float | None = None, a: float | None = None, b: float | None = None, cue_ball_id: str | None = None) None[source]#

Set the cueing parameters

Parameters:

If any arguments are None, they will be left untouched--they will not be set to None.

classmethod default() Cue[source]#

Construct a cue with defaults

Return type:

Cue

class pooltool.objects.cue.CueSpecs(brand: str = 'Predator', M: float = 0.567, length: float = 1.4732, tip_radius: float = 0.007, butt_radius: float = 0.02)[source]#

Cue stick specifications

All units are SI.

brand#

The brand.

Type:

str

M#

The mass.

Type:

float

length#

The cue length.

Type:

float

tip_radius#

The cue tip radius.

Type:

float

butt_radius#

The butt radius.

Type:

float

Methods:

static default() CueSpecs[source]#

Construct a default cue spec

Return type:

CueSpecs