generative-art-0.1.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Geometry.Chaotic

Description

Functions that vary chaotically based on their input. Useful for introducing deterministic noise in pure code, e.g. for slightly moving points around, in the middle of pure code.

Synopsis

MWC-Random chaos

class MwcChaosSource a where Source #

Create a Word32 to initialize an MWC gen with. This is meant for simple and convenient seed creation within pure code. Note that creating a generator to produce a single value is probably much less efficient than using a worse generator that is faster to seed.

Methods

mwcChaos :: a -> Word32 Source #

Instances

Instances details
MwcChaosSource Int16 Source # 
Instance details

Defined in Geometry.Chaotic

MwcChaosSource Int32 Source # 
Instance details

Defined in Geometry.Chaotic

MwcChaosSource Int64 Source # 
Instance details

Defined in Geometry.Chaotic

MwcChaosSource Int8 Source # 
Instance details

Defined in Geometry.Chaotic

Methods

mwcChaos :: Int8 -> Word32 Source #

MwcChaosSource Word16 Source # 
Instance details

Defined in Geometry.Chaotic

MwcChaosSource Word32 Source # 
Instance details

Defined in Geometry.Chaotic

MwcChaosSource Word64 Source # 
Instance details

Defined in Geometry.Chaotic

MwcChaosSource Word8 Source # 
Instance details

Defined in Geometry.Chaotic

MwcChaosSource Bezier Source # 
Instance details

Defined in Geometry.Chaotic

MwcChaosSource Hex Source # 
Instance details

Defined in Geometry.Chaotic

Methods

mwcChaos :: Hex -> Word32 Source #

MwcChaosSource Angle Source # 
Instance details

Defined in Geometry.Chaotic

MwcChaosSource BoundingBox Source # 
Instance details

Defined in Geometry.Chaotic

MwcChaosSource Line Source # 
Instance details

Defined in Geometry.Chaotic

Methods

mwcChaos :: Line -> Word32 Source #

MwcChaosSource Polygon Source # 
Instance details

Defined in Geometry.Chaotic

MwcChaosSource Vec2 Source # 
Instance details

Defined in Geometry.Chaotic

Methods

mwcChaos :: Vec2 -> Word32 Source #

MwcChaosSource Integer Source # 
Instance details

Defined in Geometry.Chaotic

MwcChaosSource () Source # 
Instance details

Defined in Geometry.Chaotic

Methods

mwcChaos :: () -> Word32 Source #

MwcChaosSource Char Source # 
Instance details

Defined in Geometry.Chaotic

Methods

mwcChaos :: Char -> Word32 Source #

MwcChaosSource Double Source # 
Instance details

Defined in Geometry.Chaotic

MwcChaosSource Float Source # 
Instance details

Defined in Geometry.Chaotic

MwcChaosSource Int Source # 
Instance details

Defined in Geometry.Chaotic

Methods

mwcChaos :: Int -> Word32 Source #

MwcChaosSource a => MwcChaosSource [a] Source # 
Instance details

Defined in Geometry.Chaotic

Methods

mwcChaos :: [a] -> Word32 Source #

(MwcChaosSource a, MwcChaosSource b) => MwcChaosSource (a, b) Source # 
Instance details

Defined in Geometry.Chaotic

Methods

mwcChaos :: (a, b) -> Word32 Source #

(MwcChaosSource a, MwcChaosSource b, MwcChaosSource c) => MwcChaosSource (a, b, c) Source # 
Instance details

Defined in Geometry.Chaotic

Methods

mwcChaos :: (a, b, c) -> Word32 Source #

(MwcChaosSource a, MwcChaosSource b, MwcChaosSource c, MwcChaosSource d) => MwcChaosSource (a, b, c, d) Source # 
Instance details

Defined in Geometry.Chaotic

Methods

mwcChaos :: (a, b, c, d) -> Word32 Source #

(MwcChaosSource a, MwcChaosSource b, MwcChaosSource c, MwcChaosSource d, MwcChaosSource e) => MwcChaosSource (a, b, c, d, e) Source # 
Instance details

Defined in Geometry.Chaotic

Methods

mwcChaos :: (a, b, c, d, e) -> Word32 Source #

initializeMwc :: (PrimMonad m, MwcChaosSource a) => a -> m (Gen (PrimState m)) Source #

Initialize an Gen with anything MwcChaosSource.

runST $ do
    gen <- initializeMwc (Vec2 3 3, regularPolygon 3)
    randomRM (Vec2 0 0, Vec2 1 1) gen

STDGen chaos

class ChaosSource a where Source #

Types that can be turned into a random number generator easily, to yield pure chaotic output.

Methods

perturb :: a -> Int Source #

Add a value to the mix the StdGen will be created from. Only used for writing new instances of ChaosSource.

To use instances of this class, use stdGen.

Instances

Instances details
ChaosSource Int16 Source # 
Instance details

Defined in Geometry.Chaotic

Methods

perturb :: Int16 -> Int Source #

ChaosSource Int32 Source # 
Instance details

Defined in Geometry.Chaotic

Methods

perturb :: Int32 -> Int Source #

ChaosSource Int64 Source # 
Instance details

Defined in Geometry.Chaotic

Methods

perturb :: Int64 -> Int Source #

ChaosSource Int8 Source # 
Instance details

Defined in Geometry.Chaotic

Methods

perturb :: Int8 -> Int Source #

ChaosSource Word16 Source # 
Instance details

Defined in Geometry.Chaotic

Methods

perturb :: Word16 -> Int Source #

ChaosSource Word32 Source # 
Instance details

Defined in Geometry.Chaotic

Methods

perturb :: Word32 -> Int Source #

ChaosSource Word64 Source # 
Instance details

Defined in Geometry.Chaotic

Methods

perturb :: Word64 -> Int Source #

ChaosSource Word8 Source # 
Instance details

Defined in Geometry.Chaotic

Methods

perturb :: Word8 -> Int Source #

ChaosSource Bezier Source # 
Instance details

Defined in Geometry.Chaotic

Methods

perturb :: Bezier -> Int Source #

ChaosSource Hex Source # 
Instance details

Defined in Geometry.Chaotic

Methods

perturb :: Hex -> Int Source #

ChaosSource Angle Source # 
Instance details

Defined in Geometry.Chaotic

Methods

perturb :: Angle -> Int Source #

ChaosSource BoundingBox Source # 
Instance details

Defined in Geometry.Chaotic

ChaosSource Line Source # 
Instance details

Defined in Geometry.Chaotic

Methods

perturb :: Line -> Int Source #

ChaosSource Polygon Source # 
Instance details

Defined in Geometry.Chaotic

Methods

perturb :: Polygon -> Int Source #

ChaosSource Vec2 Source # 
Instance details

Defined in Geometry.Chaotic

Methods

perturb :: Vec2 -> Int Source #

ChaosSource Integer Source # 
Instance details

Defined in Geometry.Chaotic

Methods

perturb :: Integer -> Int Source #

ChaosSource () Source # 
Instance details

Defined in Geometry.Chaotic

Methods

perturb :: () -> Int Source #

ChaosSource Char Source # 
Instance details

Defined in Geometry.Chaotic

Methods

perturb :: Char -> Int Source #

ChaosSource Double Source # 
Instance details

Defined in Geometry.Chaotic

Methods

perturb :: Double -> Int Source #

ChaosSource Float Source # 
Instance details

Defined in Geometry.Chaotic

Methods

perturb :: Float -> Int Source #

ChaosSource Int Source # 
Instance details

Defined in Geometry.Chaotic

Methods

perturb :: Int -> Int Source #

ChaosSource a => ChaosSource [a] Source # 
Instance details

Defined in Geometry.Chaotic

Methods

perturb :: [a] -> Int Source #

(ChaosSource a, ChaosSource b) => ChaosSource (a, b) Source # 
Instance details

Defined in Geometry.Chaotic

Methods

perturb :: (a, b) -> Int Source #

(ChaosSource a, ChaosSource b, ChaosSource c) => ChaosSource (a, b, c) Source # 
Instance details

Defined in Geometry.Chaotic

Methods

perturb :: (a, b, c) -> Int Source #

(ChaosSource a, ChaosSource b, ChaosSource c, ChaosSource d) => ChaosSource (a, b, c, d) Source # 
Instance details

Defined in Geometry.Chaotic

Methods

perturb :: (a, b, c, d) -> Int Source #

(ChaosSource a, ChaosSource b, ChaosSource c, ChaosSource d, ChaosSource e) => ChaosSource (a, b, c, d, e) Source # 
Instance details

Defined in Geometry.Chaotic

Methods

perturb :: (a, b, c, d, e) -> Int Source #

stdGen :: ChaosSource a => a -> StdGen Source #

Create a StdGen which can be used with System.Random’s functions, based on a variety of inputs.

Utilities

normals :: ChaosSource seed => seed -> [Double] Source #

Infinite list of normally distributed values.

gaussian Source #

Arguments

:: ChaosSource seed 
=> Double

Mean

-> Double

Standard deviation

-> seed 
-> [Double] 

Infinite list of Gaussian distributed values.

normalVecs :: ChaosSource seed => seed -> [Vec2] Source #

gaussianVecs :: ChaosSource seed => Double -> Double -> seed -> [Vec2] Source #