Shapes and domains

Shapes are used to define the shape of particles, and to define containers (or configurations) where all particles are placed. It is also used in plotting.

MultipleScattering.Shape — Method
Shape(shape::Shape; addtodimensions = 0.0, vector_translation = zeros(...), kws...)

Alter the shape depending on the keywords.

source
Base.in — Method
in(vector, shape)::Bool

Returns true if vector is in interior of shape, false otherwise.

source
Base.issubset — Method
issubset(shape1, shape2)::Bool

Returns true if shape1 is entirely contained within shape2, false otherwise (also works with particles).

source
MultipleScattering.:≅ — Method
iscongruent(p1::Shape, p2::Shape)::Bool
≅(p1::Shape, p2::Shape)::Bool

True if shapes are the same but in different positions (origins), standard mathematical definition.

source
MultipleScattering.boundary_functions — Function
boundary_functions(shape::Shape)::NTuple{Dim,Function}

Returns Tuple of Dim Functions which define outer boundary of shape when given boundary coordinate t∈[0,1]

source
MultipleScattering.iscongruent — Method
iscongruent(p1::Shape, p2::Shape)::Bool
≅(p1::Shape, p2::Shape)::Bool

True if shapes are the same but in different positions (origins), standard mathematical definition.

source
MultipleScattering.points_in_shape — Method
points_in_shape(Shape; resolution = 20, xres = resolution, yres = resolution,
         exclude_region = EmptyShape(region), kws...)

returns (x_vec, region_inds) where x_vec is a vector of points that cover a box which bounds Shape, and region_inds is an array of linear indices such that x_vec[region_inds] are points contained Shape. For 3D we use zres instead of yres.

source
MultipleScattering.Sphere — Type
Sphere([origin=zeros(),] radius)

A Shape where boundary is a fixed distance from the origin. In 2D this is a circle, in 3D the usual sphere, and in higher dimensions if difficult to visualise.

source
MultipleScattering.Halfspace — Type
Halfspace(normal::AbstractVector{T} [, origin::AbstractVector{T}=zeros()])

A halfspace defined by all the points $\mathbf x$ that satify $(\mathbf x - \mathbf o) \cdot \mathbf n < 0$ where $\mathbf n$ is the unit normal and $\mathbf o$ is the origin.

source
MultipleScattering.Plate — Type
Plate(normal::AbstractVector{T}, width::T, [, origin::AbstractVector{T}=zeros()])

A plate defined by all the points $\mathbf x$ that satify $|(\mathbf x - \mathbf o) \cdot \mathbf n| < w /2$ where $\mathbf n$ is the unit normal, $\mathbf o$ is the origin, and $w$ is the width.

source
MultipleScattering.Box — Type
Box([origin::AbstractVector{T}=zeros(),] dimensions::AbstractVector{T})

A Box for 2D and 3D with axis aligned sides, defined by dimensions and origin (at the center).

source
MultipleScattering.Box — Method
Box(points::Vector{v} where v <: AbstractVector)

A Box for any dimension with axis aligned sides, that is a minimal cover for the points.

source
MultipleScattering.Polygon — Type
Polygon(boundary_points::Vector; interior_points = [mean(boundary_points)])

A Shape defined by a set of points on the boundary boundary_points. The boundary_points should be ordered such that consecutive points are connected by edges of the polygon. The interior_points are a set of points that lie within the polygon. To determine whether a point is inside the polygon, see in(x::AbstractVector, poly::Polygon).

source
Base.issubset — Method
issubset(box::Box, poly::Polygon)

Returns true if the corners of the box are contained within polygon, false otherwise.

source
MultipleScattering.TimeOfFlightPlaneWaveToPoint — Type

A shape which contains all particles,$x > x_0$, necessary to simulate a plane-wave scattering from an infinite medium, for a reciever at the focal point, for time $t < D / c$, where $c$ is the sound speed of the background medium, and $D$ is some chosen focal distance. The plane-wave travels towards the positive direction of the $x$ axis.

More precisely, if the focal point is at $(x_f,y_f)$ then the interior of the shape is defined as $(y - y_f)^2 < (D + x_0)^2 - x_f^2 - 2(D + x_0 - x_f)x$ and $x > min(x_0, x_f)$ where $D$ is the focal distance.

source
MultipleScattering.TimeOfFlightPointWaveToPoint — Type

A shape where anything inside could cause a disturbance at the listener position from a point source wavefront starting at the listener. Also everything inside has a positive x coordinate. It is equivalent to a segment of a circle.

More precisely, if the listener is at (lx,ly) then the interior of the shape is defined as sqrt((x-lx)^2+(y-ly)^2)<time and x>0

source