Radian
This factor is primarily used for rotation by an angle.
A number x with factor Radian (theoretically) evaluates to e raised to the power ix. So, you could think of it as essentially a shorthand for writing both cosine and sine. NOTE however that, unlike, with the factor NatLog, we currently do not treat Radian values in quite this way in the code.
CONSIDER implementing the Radian factor conversions in a manner similar to that of NatLog. This would entail conversion from a single number to a pair of Doubles when going from Radian to PureNumber. We could do that using a Complex number but I'd rather do it as a 2-tuple of Doubles. Perhaps the whole idea of our Complex implementation is misguided (although it does allow us to represent complex numbers in Polar form since, in that case, the real part is a PureNumber number, and the imaginary part is coded in with factor Radian).
The range of these values is 0 thru 2, which represents the radian values of 0 thru 2pi.
Attributes
- Graph
-
- Supertypes
- Self type
-
Radian.type
Members list
Type members
Inherited types
The names of the product elements.
The names of the product elements.
Attributes
- Inherited from:
- Singleton
Attributes
- Inherited from:
- Singleton
The mirrored *-type.
The mirrored *-type.
Attributes
- Inherited from:
- Singleton
Attributes
- Inherited from:
- Singleton
Inherited and Abstract types
The name of the type.
The name of the type.
Attributes
- Inherited from:
- Mirror
Value members
Concrete methods
Determines whether this factor can be raised by the given factor f.
Determines whether this factor can be raised by the given factor f.
Value parameters
- f
-
the factor to be checked for compatibility with raising to a power.
Attributes
- Returns
-
true if the factors can be powered; false otherwise.
- Definition Classes
Raises the value x to the power of the value y.
Raises the value x to the power of the value y.
Value parameters
- x
-
the base value to be raised
- y
-
the exponent value (from a PureNumber)
Attributes
- Returns
-
an optional result of type
ProtoNumber, representing the computed value if the operation is valid, orNoneotherwise
Inverts the given value by raising it to the power of -1, using a pure number factor.
Inverts the given value by raising it to the power of -1, using a pure number factor.
Value parameters
- x
-
the value to be inverted
Attributes
- Returns
-
None.
Determines whether the current Radian instance represents an exact value.
Determines whether the current Radian instance represents an exact value.
Attributes
- Returns
-
true if the instance is considered exact, false otherwise.
Modulates the provided value using a monadic transformation defined by a specific range and circularity settings.
Modulates the provided value using a monadic transformation defined by a specific range and circularity settings.
TODO there are other places in the code where we use the MonadicOperationModulate more directly. We should get those place to use this method.
Value parameters
- value
-
the input value to be modulated.
Attributes
- Returns
-
the modulated value if the transformation is successful, or the original value if the operation fails.
Multiplies x with y provided that f is a PureNumber.
Multiplies x with y provided that f is a PureNumber.
Value parameters
- f
-
the factor associated with y
- x
-
the first value
- y
-
the multiplicand
Attributes
- Returns
-
an optional tuple containing the resultant value and its factor
Renders a string by appending the mathematical symbol for pi (π).
Renders a string by appending the mathematical symbol for pi (π).
Value parameters
- x
-
the input string to which the mathematical symbol for pi will be appended
Attributes
- Returns
-
a new string consisting of the input string followed by the symbol for pi
Returns the string representation of the Radian factor.
Returns the string representation of the Radian factor.
Attributes
- Returns
-
a string representation of the mathematical constant π.
- Definition Classes
-
Any
Inherited methods
Adds two values together, applying the specified factor, to compute a resultant value and factor.
Adds two values together, applying the specified factor, to compute a resultant value and factor.
TODO handle the negative cases properly
Value parameters
- f
-
the factor associated with the operation
- negative
-
NOTE ignored.
- x
-
the first value to be added
- y
-
the second value (addend) to be added
Attributes
- Returns
-
an optional tuple containing the resultant value, its factor, and optional fuzziness, or None if the operation cannot be performed under the given factor
- Inherited from:
- Scalar
Determines whether the current factor can be augmented by the given factor. CONSIDER do we need this method now that we have add(x, y, this)?
Determines whether the current factor can be augmented by the given factor. CONSIDER do we need this method now that we have add(x, y, this)?
Value parameters
- f
-
the factor to be checked for compatibility with addition.
Attributes
- Returns
-
true if the factors can be added; false otherwise.
- Inherited from:
- Factor
Determines whether the current factor can be multiplied by the given factor.
Determines whether the current factor can be multiplied by the given factor.
Value parameters
- f
-
the factor to be checked for compatibility with multiplication.
Attributes
- Returns
-
true if the factors can be multiplied; false otherwise.
- Inherited from:
- Scalar
Determines whether given value with this Factor can be rendered exactly.
Determines whether given value with this Factor can be rendered exactly.
Attributes
- Returns
-
true (value is ignored).
- Inherited from:
- Scalar
Cleans a given optional ProtoNumber by potentially simplifying its root quantities based on specific conditions and returning the modified result.
Cleans a given optional ProtoNumber by potentially simplifying its root quantities based on specific conditions and returning the modified result.
Value parameters
- po
-
an optional ProtoNumber that may be simplified
Attributes
- Returns
-
an optional ProtoNumber, simplified if applicable, or
Noneif input isNone - Inherited from:
- Factor
Convert a value x from this factor to f if possible, using simple scaling. Result is defined only if f is a Scalar.
Convert a value x from this factor to f if possible, using simple scaling. Result is defined only if f is a Scalar.
Value parameters
- f
-
the factor of the result.
- v
-
the value to be converted.
Attributes
- Returns
-
a Try of Value which, given factor f, represents the same quantity as x given this.
- Inherited from:
- Scalar
Creates a new instance of type T with elements taken from product p.
Creates a new instance of type T with elements taken from product p.
Attributes
- Inherited from:
- Singleton
Determines if the current factor satisfies certain conditions within the given context.
Determines if the current factor satisfies certain conditions within the given context.
Value parameters
- context
-
the context in which the factor is evaluated.
Attributes
- Returns
-
a Boolean indicating whether the factor satisfies the specified conditions in the given context.
- Inherited from:
- Scalar
This doesn't seem to be invoked and looks wrong anyway.
This doesn't seem to be invoked and looks wrong anyway.
Value parameters
- x
-
the value to negate
Attributes
- Returns
-
an optional
ProtoNumberrepresenting the negated value, orNoneif the operation is not valid - Inherited from:
- Scalar
An iterator over the names of all the elements of this product.
An iterator over the names of all the elements of this product.
Attributes
- Inherited from:
- Product
An iterator over all the elements of this product.
An iterator over all the elements of this product.
Attributes
- Returns
-
in the default implementation, an
Iterator[Any] - Inherited from:
- Product
Raises x to the power of y and compute an appropriate factor for the result. NOTE: for now, we only allow raising to a power of a PureNumber. TODO: enable powers of Radian factor.
Raises x to the power of y and compute an appropriate factor for the result. NOTE: for now, we only allow raising to a power of a PureNumber. TODO: enable powers of Radian factor.
Value parameters
- f
-
the factor associated with y
- x
-
the first value
- y
-
the power
Attributes
- Returns
-
an optional tuple containing the resultant value and its factor
- Inherited from:
- Factor
Concrete fields
Represents the mathematical constant π (pi), approximately equal to 3.14159. This value is commonly used in trigonometric, geometric, and other mathematical computations.
Represents the mathematical constant π (pi), approximately equal to 3.14159. This value is commonly used in trigonometric, geometric, and other mathematical computations.
Attributes
Inherited fields
Determines if the current factor operates additively.
Determines if the current factor operates additively.
Attributes
- Returns
-
true if the factor is additive; false otherwise.
- Inherited from:
- Scalar