Trigonometric Functions#

Cake offers built in support for the standard trigonometric functions which can be found in the math library.

Modifying Handlers#

You may have noticed that functions have attributes such as Function.preprocessor, but don’t know how they can be used? Simply set the attribute to the desired value.

from cake import *

my_awesome_pre_processor = lambda **kwds: kwds
f = Sin(Variable('x'))
f.preprocessor = my_awesome_pre_processor

## Now we can carry on doing what we want with f

Sin#

class cake.Sin(parameter: Any, coefficient: Any = 1, power: Any = 1)[source]#

Bases: Function

Sin function

auto_postprocess: bool#

Whether to automatically post process value

auto_prehandle: bool#

Whether to automatically pre-handle a value, this is right before the value is passed through the handler

Warning

this is after the value is converted to radians!

auto_preprocess: bool#

Whether to automatically preprocess value

auto_to_radians: bool#

Convert value to radians before passing through function

coefficient: Any#

Functions coefficient

parameter: Any#

Internal parameter of function

postprocessor: Callable[[Any], Any]#

postprocessor function

power: Any#

Power function is raised to

prehandler: Callable[[Any], Any]#

prehandler function

preprocessor: Callable[[dict], dict]#

preprocessor function, the value passed is the dictionary of given values, must return a new mapping of values to use instead.

ASin#

class cake.ASin(parameter: Any, coefficient: Any = 1, power: Any = 1)[source]#

Bases: Function

arc sin or inverse sin function

auto_postprocess: bool#

Whether to automatically post process value

auto_prehandle: bool#

Whether to automatically pre-handle a value, this is right before the value is passed through the handler

Warning

this is after the value is converted to radians!

auto_preprocess: bool#

Whether to automatically preprocess value

auto_to_radians: bool#

Convert value to radians before passing through function

coefficient: Any#

Functions coefficient

parameter: Any#

Internal parameter of function

postprocessor: Callable[[Any], Any]#

postprocessor function

power: Any#

Power function is raised to

prehandler: Callable[[Any], Any]#

prehandler function

preprocessor: Callable[[dict], dict]#

preprocessor function, the value passed is the dictionary of given values, must return a new mapping of values to use instead.

SinH#

class cake.SinH(parameter: Any, coefficient: Any = 1, power: Any = 1)[source]#

Bases: Function

Hyperbolic sin function

auto_postprocess: bool#

Whether to automatically post process value

auto_prehandle: bool#

Whether to automatically pre-handle a value, this is right before the value is passed through the handler

Warning

this is after the value is converted to radians!

auto_preprocess: bool#

Whether to automatically preprocess value

auto_to_radians: bool#

Convert value to radians before passing through function

coefficient: Any#

Functions coefficient

parameter: Any#

Internal parameter of function

postprocessor: Callable[[Any], Any]#

postprocessor function

power: Any#

Power function is raised to

prehandler: Callable[[Any], Any]#

prehandler function

preprocessor: Callable[[dict], dict]#

preprocessor function, the value passed is the dictionary of given values, must return a new mapping of values to use instead.

ASinH#

class cake.ASinH(parameter: Any, coefficient: Any = 1, power: Any = 1)[source]#

Bases: Function

Arc hyperbolic sin or inverse hyperbolic sin function

auto_postprocess: bool#

Whether to automatically post process value

auto_prehandle: bool#

Whether to automatically pre-handle a value, this is right before the value is passed through the handler

Warning

this is after the value is converted to radians!

auto_preprocess: bool#

Whether to automatically preprocess value

auto_to_radians: bool#

Convert value to radians before passing through function

coefficient: Any#

Functions coefficient

parameter: Any#

Internal parameter of function

postprocessor: Callable[[Any], Any]#

postprocessor function

power: Any#

Power function is raised to

prehandler: Callable[[Any], Any]#

prehandler function

preprocessor: Callable[[dict], dict]#

preprocessor function, the value passed is the dictionary of given values, must return a new mapping of values to use instead.

Cos#

class cake.Cos(parameter: Any, coefficient: Any = 1, power: Any = 1)[source]#

Bases: Function

Cos function

auto_postprocess: bool#

Whether to automatically post process value

auto_prehandle: bool#

Whether to automatically pre-handle a value, this is right before the value is passed through the handler

Warning

this is after the value is converted to radians!

auto_preprocess: bool#

Whether to automatically preprocess value

auto_to_radians: bool#

Convert value to radians before passing through function

coefficient: Any#

Functions coefficient

parameter: Any#

Internal parameter of function

postprocessor: Callable[[Any], Any]#

postprocessor function

power: Any#

Power function is raised to

prehandler: Callable[[Any], Any]#

prehandler function

preprocessor: Callable[[dict], dict]#

preprocessor function, the value passed is the dictionary of given values, must return a new mapping of values to use instead.

ACos#

class cake.ACos(parameter: Any, coefficient: Any = 1, power: Any = 1)[source]#

Bases: Function

arc cos or inverse cos function

auto_postprocess: bool#

Whether to automatically post process value

auto_prehandle: bool#

Whether to automatically pre-handle a value, this is right before the value is passed through the handler

Warning

this is after the value is converted to radians!

auto_preprocess: bool#

Whether to automatically preprocess value

auto_to_radians: bool#

Convert value to radians before passing through function

coefficient: Any#

Functions coefficient

parameter: Any#

Internal parameter of function

postprocessor: Callable[[Any], Any]#

postprocessor function

power: Any#

Power function is raised to

prehandler: Callable[[Any], Any]#

prehandler function

preprocessor: Callable[[dict], dict]#

preprocessor function, the value passed is the dictionary of given values, must return a new mapping of values to use instead.

CosH#

class cake.CosH(parameter: Any, coefficient: Any = 1, power: Any = 1)[source]#

Bases: Function

Hyperbolic cos function

auto_postprocess: bool#

Whether to automatically post process value

auto_prehandle: bool#

Whether to automatically pre-handle a value, this is right before the value is passed through the handler

Warning

this is after the value is converted to radians!

auto_preprocess: bool#

Whether to automatically preprocess value

auto_to_radians: bool#

Convert value to radians before passing through function

coefficient: Any#

Functions coefficient

parameter: Any#

Internal parameter of function

postprocessor: Callable[[Any], Any]#

postprocessor function

power: Any#

Power function is raised to

prehandler: Callable[[Any], Any]#

prehandler function

preprocessor: Callable[[dict], dict]#

preprocessor function, the value passed is the dictionary of given values, must return a new mapping of values to use instead.

ACosH#

class cake.ACosH(parameter: Any, coefficient: Any = 1, power: Any = 1)[source]#

Bases: Function

Arc hyperbolic cos or inverse hyperbolic cos function

auto_postprocess: bool#

Whether to automatically post process value

auto_prehandle: bool#

Whether to automatically pre-handle a value, this is right before the value is passed through the handler

Warning

this is after the value is converted to radians!

auto_preprocess: bool#

Whether to automatically preprocess value

auto_to_radians: bool#

Convert value to radians before passing through function

coefficient: Any#

Functions coefficient

parameter: Any#

Internal parameter of function

postprocessor: Callable[[Any], Any]#

postprocessor function

power: Any#

Power function is raised to

prehandler: Callable[[Any], Any]#

prehandler function

preprocessor: Callable[[dict], dict]#

preprocessor function, the value passed is the dictionary of given values, must return a new mapping of values to use instead.

Tan#

class cake.Tan(parameter: Any, coefficient: Any = 1, power: Any = 1)[source]#

Bases: Function

tan function

auto_postprocess: bool#

Whether to automatically post process value

auto_prehandle: bool#

Whether to automatically pre-handle a value, this is right before the value is passed through the handler

Warning

this is after the value is converted to radians!

auto_preprocess: bool#

Whether to automatically preprocess value

auto_to_radians: bool#

Convert value to radians before passing through function

coefficient: Any#

Functions coefficient

parameter: Any#

Internal parameter of function

postprocessor: Callable[[Any], Any]#

postprocessor function

power: Any#

Power function is raised to

prehandler: Callable[[Any], Any]#

prehandler function

preprocessor: Callable[[dict], dict]#

preprocessor function, the value passed is the dictionary of given values, must return a new mapping of values to use instead.

ATan#

class cake.ATan(parameter: Any, coefficient: Any = 1, power: Any = 1)[source]#

Bases: Function

arc tan or inverse tan function

auto_postprocess: bool#

Whether to automatically post process value

auto_prehandle: bool#

Whether to automatically pre-handle a value, this is right before the value is passed through the handler

Warning

this is after the value is converted to radians!

auto_preprocess: bool#

Whether to automatically preprocess value

auto_to_radians: bool#

Convert value to radians before passing through function

coefficient: Any#

Functions coefficient

parameter: Any#

Internal parameter of function

postprocessor: Callable[[Any], Any]#

postprocessor function

power: Any#

Power function is raised to

prehandler: Callable[[Any], Any]#

prehandler function

preprocessor: Callable[[dict], dict]#

preprocessor function, the value passed is the dictionary of given values, must return a new mapping of values to use instead.

ATan2#

class cake.ATan2(parameter: Any, coefficient: Any = 1, power: Any = 1)[source]#

Bases: Function

arc tan2 or inverse tan2 function

auto_postprocess: bool#

Whether to automatically post process value

auto_prehandle: bool#

Whether to automatically pre-handle a value, this is right before the value is passed through the handler

Warning

this is after the value is converted to radians!

auto_preprocess: bool#

Whether to automatically preprocess value

auto_to_radians: bool#

Convert value to radians before passing through function

coefficient: Any#

Functions coefficient

parameter: Any#

Internal parameter of function

postprocessor: Callable[[Any], Any]#

postprocessor function

power: Any#

Power function is raised to

prehandler: Callable[[Any], Any]#

prehandler function

preprocessor: Callable[[dict], dict]#

preprocessor function, the value passed is the dictionary of given values, must return a new mapping of values to use instead.

TanH#

class cake.TanH(parameter: Any, coefficient: Any = 1, power: Any = 1)[source]#

Bases: Function

Hyperbolic tan function

auto_postprocess: bool#

Whether to automatically post process value

auto_prehandle: bool#

Whether to automatically pre-handle a value, this is right before the value is passed through the handler

Warning

this is after the value is converted to radians!

auto_preprocess: bool#

Whether to automatically preprocess value

auto_to_radians: bool#

Convert value to radians before passing through function

coefficient: Any#

Functions coefficient

parameter: Any#

Internal parameter of function

postprocessor: Callable[[Any], Any]#

postprocessor function

power: Any#

Power function is raised to

prehandler: Callable[[Any], Any]#

prehandler function

preprocessor: Callable[[dict], dict]#

preprocessor function, the value passed is the dictionary of given values, must return a new mapping of values to use instead.

ATanH#

class cake.ATanH(parameter: Any, coefficient: Any = 1, power: Any = 1)[source]#

Bases: Function

Arc hyperbolic tan or inverse hyperbolic tan function

auto_postprocess: bool#

Whether to automatically post process value

auto_prehandle: bool#

Whether to automatically pre-handle a value, this is right before the value is passed through the handler

Warning

this is after the value is converted to radians!

auto_preprocess: bool#

Whether to automatically preprocess value

auto_to_radians: bool#

Convert value to radians before passing through function

coefficient: Any#

Functions coefficient

parameter: Any#

Internal parameter of function

postprocessor: Callable[[Any], Any]#

postprocessor function

power: Any#

Power function is raised to

prehandler: Callable[[Any], Any]#

prehandler function

preprocessor: Callable[[dict], dict]#

preprocessor function, the value passed is the dictionary of given values, must return a new mapping of values to use instead.