k-Wave Toolbox
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 1's in the matrix with 0's 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

two-element vector identifying the start point for the line [grid points]

endpoint

two-element vector identifying the end point for 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-2014 Bradley Treeby and Ben Cox.