Random
Usage of random point generators is straightforward:
julia> using PhysicalParticlesjulia> rand(PVector{Float64}, 3, 3)3×3 Matrix{PVector{Float64}}: PVector{Float64}(0.332195, 0.613335, 0.600889) … PVector{Float64}(0.706133, 0.25126, 0.809123) PVector{Float64}(0.500264, 0.660036, 0.839655) PVector{Float64}(0.868006, 0.728044, 0.619017) PVector{Float64}(0.768959, 0.355226, 0.912161) PVector{Float64}(0.887582, 0.0509259, 0.379806)julia> rand(PVector2D{Int}, 3)3-element Vector{PVector2D{Int64}}: PVector2D{Int64}(-3882767884619748729, 355311127004983354) PVector2D{Int64}(-7789541397397584553, -6637599058884614965) PVector2D{Int64}(8062131901706244502, -6089771006157368103)julia> p = randn_pvector(3)3-element Vector{PVector{Float64}}: PVector{Float64}(-1.2603809770329226, 0.03756278848612104, 1.2504781307005013) PVector{Float64}(-0.8387872406712977, 1.432018863135833, -0.510040566826012) PVector{Float64}(-0.2587998182802357, -0.10978874259495285, 0.21448257802847104)julia> pu = randn_pvector(3, u"m")3-element Vector{PVector{Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}}}: PVector(1.6038302151196024 m, 1.5930144686133099 m, 1.3486369630538058 m) PVector(-1.3697746632690253 m, 1.057567446613012 m, -1.2287968437562227 m) PVector(-0.6523768792139476 m, -0.2183713023158798 m, -1.7420143291066643 m)
To generate vectors in normal distribution:
randn_pvector(n::Integer)
randn_pvector(n::Integer, T::DataType)
randn_pvector(n::Integer, u::Unitful.Units)
randn_pvector(n::Integer, u::Unitful.Units, T::DataType)
randn_pvector2d(n::Integer)
randn_pvector2d(n::Integer, T::DataType)
randn_pvector2d(n::Integer, u::Unitful.Units)
randn_pvector2d(n::Integer, u::Unitful.Units, T::DataType)