# RandomService

RandomService is an Angular Factory in the Util module with the name `random.js`

. It provides useful functions that use random numbers. To use these functions, see the documentation on injecting Angular services.

Name | Summary |
---|---|

`spread` | Given a value, will return a random integer between -value / 2 and value / 2. |

`randomDim` | For a given dimension, return a number from 0 to the dimension, within constraints. |

# Function Descriptions

## spread

Given a value, will return a random integer between -value / 2 and value / 2.

Example Usage | Arguments | Return Value |
---|---|---|

rs.spread( ); | - any number | given some value, /2 and /2 Example: |

## randomDim

For a given dimension, return a number from 0 to the dimension, within constraints.

Example Usage | Arguments | Return Value |
---|---|---|

rs.randomDim( ); | - any number | for a given dimension, where the value is within ( / (2 * sqrt(2))) of `d` /2.`d` |