Quaternion Function Reference

randv

Uniformly distributed vectors (pure quaternions)

Syntax

Y = randv(varargin)

Description

randv constructs uniformly distributed unit vectors (distributed uniformly in 3-space). It accepts the same parameters as the MATLAB® functions rand and randn.

Each unit vector returned is the result of two calls on the MATLAB® function rand, and hence randv modifies the state of the generator used by rand. To initialise the generator or control the choice of generator, use rand.

Examples

>> randv(2)
 
ans = 2x2 pure quaternion array
 
>> abs(ans)

ans =

    1.0000    1.0000
    1.0000    1.0000

See Also

QTFM function: randq
MATLAB® function: rand

© 2008-2013 Stephen J. Sangwine and Nicolas Le Bihan

License terms.