Thousands of tools! Check out Online Tools – I have now added thousands of tools.
I often have to generate random vectors so I created this simple online utility that does it for me. It lets you generate random row or column vectors with any number of elements. It works in the browser and is powered by alien technology from the future.
Random Vector Generator Options
Random Vector Generator Examples (click to try!)
{"27", "10", "34", "14", "21"}
[ '265165' '776705' '604019' '574885' '940191' '521704' '392172' '530477' ]
<-0.388><1.225><4.285><-2.738><-4.644><-4.065><-2.890><-1.657><-4.786><-1.748><3.116><1.620><-3.592><-2.470><-3.740><0.731><1.513><2.168><-4.594><3.786><3.171><-0.777><-2.206><1.948><-1.865><1.463><-1.102><2.917><-2.356><2.969>
How Does This Random Vector Generator Work?
This random vector generator works entirely in your browser and is written in JavaScript. First, it checks if start
and end
values (vector element range; specified in the options) are valid and then repeatedly uses the formula Math.random() * (end - start) + start
to generate vector coordinates. If the coordinates are integers, then it also Math.floor()
s them. It stores the coordinates in an array randVect
that is of size length
(vector length; specified in options). Before push()
ing each random element to the randVect
array it wraps it in before-elem
and after-elem
characters (symbols that get added before and after each vector element). When the randVect.length
reaches the length
value, it converts all vector components to a string by using the join(separator)
function. If a row vector is generated, it uses the separator
from options, but if it's a column vector, then the separator
is set to the \n
(newline) symbol. Right before printing the string to the screen, it also adds the before-vect
and after-vect
(symbols that get added before and after the entire vector; specified in options) to the string.
Created by Browserling
This random vector generator was created by me and my team at Browserling. Behind the scenes, it's actually powered by our web developer tools that are used by millions of people every month. Browserling itself is an online cross-browser testing service powered by alien technology. Check it out!
Secret message: If you love my tools, then I love you, too! Use coupon code TOOLLING to get a discount at my company.