obj::calc::BinomialIdentity Class Reference

These objects are expanded using : (a+b)² = a² + 2ab + b², (a-b)² = a² -2ab + b² and (a+b)(a-b) = a² - b² This object is a Product of two Sums but won't be displayed as is in the case of (a+b)² and (a-b)². More...

Inheritance diagram for obj::calc::BinomialIdentity:
obj::calc::Expandable obj::calc::Product obj::calc::Operation obj::calc::Exponented obj::calc::Calculable obj::Printable

List of all members.

Public Member Functions

def __init__
 Constructor.
def expand
 The expanded object, like (2x+3)² would return (2x)²+2×2x×3+3².
def expand_and_reduce_next_step
 Returns the next step of reduction of the BinomialIdentity.
def make_string
 Creates a string of the given object in the given ML.

Detailed Description

These objects are expanded using : (a+b)² = a² + 2ab + b², (a-b)² = a² -2ab + b² and (a+b)(a-b) = a² - b² This object is a Product of two Sums but won't be displayed as is in the case of (a+b)² and (a-b)².

For instance, (3x-2)(3x-2) will be displayed (3x-2)². It would be complicated to derive BinomialIdentity from a Sum since a Sum isn't expandable. Let it derive simultaneously from Sum and Expandable could create problems when calling the make_string function (which of the Sum's or the Product's would be called ?).

Definition at line 8557 of file __init__.py.


Member Function Documentation

def obj::calc::BinomialIdentity::__init__ (   self,
  arg,
  options 
)

Constructor.

Parameters:
arg (Exponented, Exponented)|(__.RANDOMLY, <type>) Types details :

  • sum_square : matches (a+b)²
  • difference_square : matches (a-b)²
  • squares_difference : matches (a+b)(a-b) (name comes from a²-b²)
  • any : matches any of (a+b)², (a-b)², (-a+b)², (-a-b)², (a+b)(a-b)...
  • numeric_* : matches a numeric one...
options squares_difference Options details :

  • in the case of arg being (Exponented, Exponented), squares_difference let produce a (a+b)(a-b) from the given Exponenteds instead of a default (a+b)²
Warning:
Might raise an UncompatibleType exception.
Todo:
fix the square_difference option (see source code)

Reimplemented from obj::calc::Expandable.

Definition at line 8580 of file __init__.py.

def obj::calc::BinomialIdentity::expand_and_reduce_next_step (   self,
  options 
)

Returns the next step of reduction of the BinomialIdentity.

Returns:
Exponented

Reimplemented from obj::calc::Expandable.

Definition at line 8808 of file __init__.py.

def obj::calc::BinomialIdentity::make_string (   self,
  markup,
  options 
)

Creates a string of the given object in the given ML.

Parameters:
markup The markup dictionary to use
options Any options
Returns:
The formated string

Reimplemented from obj::calc::Product.

Definition at line 8821 of file __init__.py.


The documentation for this class was generated from the following file:
Generated on Fri Dec 30 19:26:37 2011 for mathmaker by  doxygen 1.6.3