Hi Diwaker,
The source shape is defined as a binary matrix (i.e., a matrix of 1's and 0's) where the 1's (or 'trues') correspond to the source elements within the grid. This can be anything you want.
If you are using the function makeCircle
, this creates a binary mask of a circle using the midpoint circle algorithm based on the input parameters, one of which is the arc angle. Within the function, this is defined clockwise from the negative x-axis. As such, a 90° arc as in the Simulating Transducer Field Patterns Example will point diagonally across the domain from the top left to the bottom right.
If you want to create an arc pointing in another direction, you can create a complete circle in the position you require, and then mask out the elements you don't need. For example, to create an arc pointing downwards you could use something like:
Nx = 128;
Nz = 128;
arc_radius = 20;
arc_height = 10;
x_pos = Nx/2;
z_pos = 25;
arc = makeCircle(Nx, Nz, x_pos, z_pos, arc_radius);
arc(z_pos - arc_radius + arc_height:end, :) = 0;
imagesc(arc);
axis image;
I hope that helps,
Brad.