# Primary Bulb
The child bulb of the period
cardioid at internal angle
has external angles:
where
# 1 Haskell Code
import Data.Fixed (mod')
import Data.List (genericTake)
import Data.Ratio (denominator)
type InternalAngle = Rational
type ExternalAngle = ([Bool], [Bool])
primaryBulb
:: InternalAngle
-> (ExternalAngle, ExternalAngle)
primaryBulb pq
= ( ([], bs ++ [False, True])
, ([], bs ++ [True, False])
)
where
q = denominator pq
bs
= genericTake (q - 2)
. map (\x -> 1 - pq < x && x < 1)
. iterate (\x -> (x + pq) `mod'` 1)
$ pq
# 2 Examples
Consider the bulb at internal angle
:
Therefore the external angles for the
bulb are: