ruff-0.2: relatively useful fractal functions




External angles give rise to kneading sequences under the angle doubling map. Internal addresses encode kneading sequences in human-readable form, when extended to angled internal addresses they distinguish hyperbolic components in a concise and meaningful way.

The algorithms are mostly based on Dierk Schleicher's paper Internal Addresses Of The Mandelbrot Set And Galois Groups Of Polynomials (version of February 5, 2008)



type Angle = RationalSource

Angle as a fraction of a turn, usually in [0, 1).

double :: Angle -> AngleSource

Angle doubling map.

wrap :: Angle -> AngleSource

Wrap an angle into [0, 1).

prettyAngle :: Angle -> StringSource

Convert to human readable form.

prettyAngles :: [Angle] -> StringSource

Convert to human readable form.

data Knead Source

Elements of kneading sequences.



kneadChar :: Knead -> CharSource

Knead character representation.

data Kneading Source

Kneading sequences. Note that the Aperiodic case has an infinite list.

prettyKneading :: Kneading -> StringSource

Kneading sequence as a string. The Aperiodic case is truncated arbitrarily.

kneading :: Angle -> KneadingSource

The kneading sequence for an external angle.

period :: Kneading -> Maybe IntegerSource

The period of a kneading sequence, or Nothing when it isn't periodic.

unwrap :: Kneading -> [Knead]Source

Unwrap a kneading sequence to an infinite list.

associated :: Kneading -> Maybe (Kneading, Kneading)Source

A star-periodic kneading sequence's upper and lower associated kneading sequences.

upper :: Kneading -> Maybe KneadingSource

The upper associated kneading sequence.

lower :: Kneading -> Maybe KneadingSource

The lower associated kneading sequence.

data InternalAddress Source

Internal addresses are a non-empty sequence of strictly increasing integers beginning with '1'.


InternalAddress [Integer] 

prettyInternalAddress :: InternalAddress -> StringSource

Internal address as a string.

internalAddress :: Kneading -> Maybe InternalAddressSource

Construct an InternalAddress from a kneading sequence.

internalFromList :: [Integer] -> Maybe InternalAddressSource

Construct a valid InternalAddress, checking the precondition.

internalToList :: InternalAddress -> [Integer]Source

Extract the sequence of integers.

prettyAngledInternalAddress :: AngledInternalAddress -> StringSource

Angled internal address as a string.

angledInternalAddress :: Angle -> Maybe AngledInternalAddressSource

The angled internal address corresponding to an external angle.

angledFromList :: [(Integer, Maybe Angle)] -> Maybe AngledInternalAddressSource

Builds a valid AngledInternalAddress from a list, checking the precondition that only the last 'Maybe Angle' should be Nothing, and the Integer must be strictly increasing.

externalAngles :: AngledInternalAddress -> Maybe (Rational, Rational)Source

The pair of external angles whose rays land at the root of the hyperbolic component described by the angled internal address.

stripAngles :: AngledInternalAddress -> InternalAddressSource

Discard angle information from an internal address.

splitAddress :: AngledInternalAddress -> (AngledInternalAddress, [Angle])Source

Split an angled internal address at the last island.

addressPeriod :: AngledInternalAddress -> IntegerSource

The period of an angled internal address.

parseAngle :: String -> Maybe AngleSource

Parse an angle.

parseAngles :: String -> Maybe [Angle]Source

Parse a list of angles.

parseKnead :: String -> Maybe KneadSource

Parse a kneading element.

parseKneading :: String -> Maybe KneadingSource

Parse a non-aperiodic kneading sequence.

parseInternalAddress :: String -> Maybe InternalAddressSource

Parse an internal address.

parseAngledInternalAddress :: String -> Maybe AngledInternalAddressSource

Parse an angled internal address, accepting some unambiguous abbreviations.