φ Famo.us University Famo.us/Angular Docs Help Blog Download
  • core
  • Context
  • ElementAllocator
  • ElementOutput
  • Engine
  • Entity
  • EventEmitter
  • EventHandler
  • Group
  • Modifier
  • OptionsManager
  • RenderNode
  • Scene
  • SpecParser
  • Transform
  • View
  • ViewSequence
  • events
  • EventArbiter
  • EventFilter
  • EventMapper
  • inputs
  • Accumulator
  • GenericSync
  • MouseSync
  • PinchSync
  • RotateSync
  • ScaleSync
  • ScrollSync
  • TouchSync
  • TouchTracker
  • TwoFingerSync
  • math
  • Matrix
  • Quaternion
  • Random
  • Utilities
  • Vector
  • modifiers
  • Draggable
  • Fader
  • ModifierChain
  • StateModifier
  • physics
  • PhysicsEngine
  • physics/bodies
  • Body
  • Circle
  • Particle
  • Rectangle
  • physics/constraints
  • Surface
  • Collision
  • Constraint
  • Curve
  • Distance
  • Snap
  • Wall
  • Walls
  • physics/forces
  • Drag
  • Force
  • Repulsion
  • RotationalDrag
  • RotationalSpring
  • Spring
  • VectorField
  • physics/integrators
  • SymplecticEuler
  • surfaces
  • CanvasSurface
  • ContainerSurface
  • ImageSurface
  • InputSurface
  • TextareaSurface
  • VideoSurface
  • transitions
  • CachedMap
  • Easing
  • MultipleTransition
  • SnapTransition
  • SpringTransition
  • Transitionable
  • TransitionableTransform
  • TweenTransition
  • WallTransition
  • utilities
  • KeyCodes
  • Timer
  • Utility
  • views
  • ContextualView
  • Deck
  • DrawerLayout
  • EdgeSwapper
  • FlexibleLayout
  • Flipper
  • GridLayout
  • HeaderFooterLayout
  • Lightbox
  • RenderController
  • ScrollContainer
  • Scroller
  • Scrollview
  • SequentialLayout
  • widgets
  • NavigationBar
  • TabBar

Random

Very simple uniform random number generator library wrapping Math.random().

Overview

Methods
integer
range
sign
bool
Methods

integer(min, max, dim)

Get single random integer between min and max (inclusive), or array of size dim if specified.

Parameters
min
Number
lower bound, default 0
max
Number
upper bound, default 1
dim
Number
(optional) dimension of output array, if specified
Returns
Number | array<number>
random integer, or optionally, an array of random integers

range(min, max, dim)

Get single random float between min and max (inclusive), or array of size dim if specified

Parameters
min
Number
lower bound, default 0
max
Number
upper bound, default 1
dim
Number
dimension of output array, if specified
Returns
Number
random float, or optionally an array

sign(prob)

Return random number among the set {-1 ,1}

Parameters
prob
Number
probability of returning 1, default 0.5
Returns
Number
random sign (-1 or 1)

bool(prob)

Return random boolean value, true or false.

Parameters
prob
Number
probability of returning true, default 0.5
Returns
Boolean
random boolean
Branding Terms Privacy Jobs © Famous Industries, Inc. 2015