k-Wave Toolbox Previous   Next

makeLine

Create a binary map of a line within a 2D grid

Syntax

line = makeLine(Nx, Ny, startpoint, endpoint)
line = makeLine(Nx, Ny, startpoint, angle, length)

Description

makeLine creates a binary map of a line within a two-dimensional grid (the line is denoted by 1s in the matrix with 0s elsewhere). The line can be defined either by its endpoints or by a starting point, an angle (direction) and a length.

Inputs

Nx, Ny

size of the 2D grid [grid points]

startpoint, endpoint

two-element vectors identifying the ends of the line [grid points]

angle

the direction of the line [radians]

length

the length of the line [grid points]

Outputs

line

2D binary map of a line

See Also

makeCircle, makeDisc


© 2009-2012 Bradley Treeby and Ben Cox.