new array geometry generator

This commit is contained in:
zymon 2023-11-18 23:42:12 +01:00
parent 276718a076
commit d33eccf072

View file

@ -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]