EulerSumCommutative

com.phasmidsoftware.number.expression.expr.EulerSumCommutative

Commutative extractor for the Euler recognition pattern cos(θ) + i·sin(θ).

Matches a pair (left, right) where one side is cos(θ) and the other is i·sin(θ) (in either multiplication order), returning (θ_from_cos, θ_from_sin). The caller guards with θ1 == θ2.

extractLeft excludes the i·sin shape so the two roles are mutually exclusive, preventing the swap path from producing spurious matches.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Inherited methods

def unapply(pair: (Expression, Expression)): Option[(Expression, Expression)]

Unapply method that tries both orderings on a tuple. First tries (extractLeft(left), extractRight(right)), then tries (extractLeft(right), extractRight(left)).

Unapply method that tries both orderings on a tuple. First tries (extractLeft(left), extractRight(right)), then tries (extractLeft(right), extractRight(left)).

Attributes

Inherited from:
CommutativeExtractor