ContinuedFraction

com.phasmidsoftware.number.core.misc.ContinuedFraction
See theContinuedFraction companion class

This object represents utility methods and predefined constants for working with continued fractions. It provides functionality to construct, transform, and manipulate ContinuedFraction instances.

Attributes

Companion
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements.

The names of the product elements.

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type.

The name of the type.

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def apply(ps: LazyList[Pair], infinite: Boolean, markov: Double): ContinuedFraction

Construct a ContinuedFraction based on a LazyList of Pairs.

Construct a ContinuedFraction based on a LazyList of Pairs.

Value parameters

infinite

true if xs is infinite (defaults to true).

markov

the value of Markov constant (defaults to Hurwitz).

ps

a lazy list of Pairs.

Attributes

Returns

a ContinuedFraction

def apply(f: () => LazyList[Pair], infinite: Boolean, markov: Double): ContinuedFraction

Construct a ContinuedFraction based on a function.

Construct a ContinuedFraction based on a function.

CONSIDER changing the f to be Int => Pair.

Value parameters

f

a function which yields a LazyList of Pairs.

infinite

true if xs is infinite (defaults to true).

markov

the value of the Markov constant (defaults to Hurwitz).

Attributes

Returns

a ContinuedFraction

def createInfinite(sequence: List[Pair], f: List[Pair] => List[Pair]): ContinuedFraction

Construct a ContinuedFraction based on an initial pair sequence and a transforming function.

Construct a ContinuedFraction based on an initial pair sequence and a transforming function.

Value parameters

f

a function which repeatedly transforms the current sequence.

sequence

a sequence of Pairs which will be form the initial pattern.

Attributes

Returns

a ContinuedFraction.

Construct a ContinuedFraction based on an initial pattern and a transforming function.

Construct a ContinuedFraction based on an initial pattern and a transforming function.

Value parameters

f

a function which repeatedly transforms the current Pair value.

start

a starting Pair value.

Attributes

Returns

a ContinuedFraction

def createInfinite(sequence: List[Pair]): ContinuedFraction

Construct a ContinuedFraction based on a function.

Construct a ContinuedFraction based on a function.

Value parameters

sequence

a sequence of Pairs which will be repeated.

Attributes

Returns

a ContinuedFraction

Construct a ContinuedFraction based on a repeated pair.

Construct a ContinuedFraction based on a repeated pair.

Value parameters

p

a Pair which will be repeated continually to create the coefficients of a ContinueFraction.

Attributes

Returns

a ContinuedFraction

Construct a simple ContinuedFraction based on a repeated constant. Basically, this creates the series for phi.

Construct a simple ContinuedFraction based on a repeated constant. Basically, this creates the series for phi.

Value parameters

x

a Long value which will be repeated continually to create the simple ContinuedFraction.

Attributes

Returns

a (simple) ContinuedFraction.

def createInfiniteWithMarkov(sequence: List[Pair], f: List[Pair] => List[Pair], markov: Double): ContinuedFraction

Construct a ContinuedFraction based on an initial pattern and a transforming function.

Construct a ContinuedFraction based on an initial pattern and a transforming function.

Value parameters

f

a function which repeatedly transforms the current sequence.

markov

the value of Markov constant (defaults to Hurwitz).

sequence

a sequence of Pairs which will be form the initial pattern.

Attributes

Returns

a ContinuedFraction

def createInfiniteWithMarkov(start: Pair, f: Pair => Pair, markov: Double): ContinuedFraction

Construct a ContinuedFraction based on an initial pattern and a transforming function.

Construct a ContinuedFraction based on an initial pattern and a transforming function.

Value parameters

f

a function which repeatedly transforms the current Pair value.

markov

the value of Markov constant (defaults to Hurwitz).

start

a starting Pair value.

Attributes

Returns

a ContinuedFraction

def createInfiniteWithMarkov(sequence: List[Pair], markov: Double): ContinuedFraction

Construct a ContinuedFraction based on a repeated sequence.

Construct a ContinuedFraction based on a repeated sequence.

Value parameters

markov

the value of Markov constant (defaults to Hurwitz).

sequence

a sequence of Pairs which will be repeated.

Attributes

Returns

a ContinuedFraction

Concrete fields

ContinuedFaction representing e.

ContinuedFaction representing e.

Attributes

Represents the continued fraction for 4 divided by Pi, derived using the Leibniz series.

Represents the continued fraction for 4 divided by Pi, derived using the Leibniz series.

This is an infinite continued fraction built using the function fPiBy4Leibniz. The default Markov constant, Hurwitz, is used.

Attributes

val Hurwitz: Double

The Markov constant for all irrational numbers. Many individual irrationals can use a smaller value for their Markov number. See https://en.wikipedia.org/wiki/Hurwitz%27s_theorem_(number_theory) See https://en.wikipedia.org/wiki/Markov_constant

The Markov constant for all irrational numbers. Many individual irrationals can use a smaller value for their Markov number. See https://en.wikipedia.org/wiki/Hurwitz%27s_theorem_(number_theory) See https://en.wikipedia.org/wiki/Markov_constant

Attributes

Represents the continued fraction representation of π (Pi) using a specific functional series, denoting an infinite continued fraction approximation of the mathematical constant π.

Represents the continued fraction representation of π (Pi) using a specific functional series, denoting an infinite continued fraction approximation of the mathematical constant π.

This value is built using the fPi function as its series function and specifies that the continued fraction is infinite. The Markov constant used in this instance is Hurwitz.

Attributes

ContinuedFaction representing pi.

ContinuedFaction representing pi.

Attributes

Represents an infinite continued fraction of Pi based on the fPiSomayaji function.

Represents an infinite continued fraction of Pi based on the fPiSomayaji function.

This specific continued fraction is constructed using the fPiSomayaji generator function, designating it to be infinite and associated with the Hurwitz Markov constant.

Attributes

val fPiBy4Leibniz: LazyList[Pair]

This is the Leibniz formula for pi.

This is the Leibniz formula for pi.

Attributes

ContinuedFaction representing the golden ratio (phi).

ContinuedFaction representing the golden ratio (phi).

Attributes

ContinuedFaction representing the square root of 19.

ContinuedFaction representing the square root of 19.

Attributes

ContinuedFaction representing the square root of 2.

ContinuedFaction representing the square root of 2.

Attributes

ContinuedFaction representing the square root of 3.

ContinuedFaction representing the square root of 3.

Attributes