pooltool.objects.ball.params#
Overview#
Ball parameters and physical constants |
|
An Enum specifying prebuilt ball parameters |
Classes#
- class pooltool.objects.ball.params.BallParams(m: float = 0.170097, R: float = 0.028575, u_s: float = 0.2, u_r: float = 0.01, u_sp_proportionality: float = 0.4444444444444444, e_c: float = 0.85, f_c: float = 0.2, g: float = 9.81)[source]#
Ball parameters and physical constants
- u_sp_proportionality#
The spinning coefficient of friction, with R factored out (default = 0.01).
See also
For the coefficient of spinning friction, use the property
u_sp().
- Type:
- e_c#
The cushion coefficient of restitution (default = 0.85).
Note
This is a potentially model-dependent ball-cushion parameter and should be placed elsewhere, either as a model parameter or as a cushion segment parameter.
- Type:
- f_c#
The cushion coefficient of friction (default = 0.2).
Note
This is a potentially model-dependent ball-cushion parameter and should be placed elsewhere, either as a model parameter or as a cushion segment parameter.
- Type:
Most of the default values (SI units) are taken from or based off of https://billiards.colostate.edu/faq/physics/physical-properties/.
Some of the parameters aren’t truly ball parameters, e.g. the gravitational constant. However, it is nice to be able to tune such parameters on a ball-by-ball basis, so they are included here.
Methods:
- u_sp() float#
Coefficient of spinning friction
This is equal to
u_sp_proportionality*RCached Property Note
This is a cached property, and should be accessed as an attribute, not as a method call.
- Return type:
- copy() BallParams[source]#
Return a copy
Note
Since the class is frozen and its attributes are immutable, this just returns
self.
- Return type:
- classmethod default(game_type: pooltool.game.datatypes.GameType = GameType.EIGHTBALL) BallParams[source]#
Return prebuilt ball parameters based on game type
- Parameters:
game_type (pooltool.game.datatypes.GameType) -- What type of game is being played?
- Returns:
The prebuilt ball parameters associated with the passed game type.
- Return type:
- classmethod prebuilt(name: PrebuiltBallParams) BallParams[source]#
Return prebuilt ball parameters based on name
- Parameters:
name (PrebuiltBallParams) -- A
PrebuiltBallParamsmember.- Return type:
All prebuilt ball parameters are named with the
PrebuiltBallParamsEnum. This constructor takes a prebuilt name and returns the corresponding ball parameters.See also