new array geometry generator
This commit is contained in:
parent
276718a076
commit
d33eccf072
1 changed files with 7 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
module TxRxModels
|
module TxRxModels
|
||||||
|
|
||||||
|
using Statistics
|
||||||
using LinearAlgebra
|
using LinearAlgebra
|
||||||
using StaticArrays
|
using StaticArrays
|
||||||
|
|
||||||
|
@ -198,6 +199,12 @@ function circular_array(N::Integer, r::Real)
|
||||||
[SVector{3}([r * cos(α), r * sin(α), 0]) for α ∈ 0:Δα:2π-Δα]
|
[SVector{3}([r * cos(α), r * sin(α), 0]) for α ∈ 0:Δα:2π-Δα]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function square_array(N::I, M::I, Lx::T, Ly::T) where {I<:Integer, T<:Real}
|
||||||
|
Δx, Δy = Lx / N, Ly / N
|
||||||
|
p = [SVector{3}([Δx*i, Δy*j, 0.0]) for i = 1:N for j = 1:M]
|
||||||
|
p .- [mean(p)]
|
||||||
|
end
|
||||||
|
|
||||||
function fibonacci_array(N::Integer, r::Real)
|
function fibonacci_array(N::Integer, r::Real)
|
||||||
P = fibonacci_sphere(N)
|
P = fibonacci_sphere(N)
|
||||||
[SVector{3}(r .* p) for p in P]
|
[SVector{3}(r .* p) for p in P]
|
||||||
|
|
Loading…
Reference in a new issue