For a set of junction points that describe a simplified cell, this function extracts the left-most wall and the right-most wall and calculates their slope and bearing (in radians).

endwall_angles(junction_points)

Arguments

junction_points

This should be a matrix of the junction points defining the polygon. The first and last points are the same (i.e. the line formed by the points is closed).

Value

A list with the following components:

slope1

The slope of the leftmost endwall. Useful for plotting.

slope2

The slope of the rightmost endwall.

angle1

The angle of the leftmost endwall. Useful for analysis.

angle2

The angle of the rightmost endwall.

points1

The points defining the leftmost endwall.

points2

The points defining the rightmost endwall.

Details

The endwalls are defined as the cell walls that define the length of the cell along the leaf axis (i.e. stomatal north). Note that this trait is only truly applicable to species that have broadly rectangular or polygonal cells AND where the leaf axis is known (or can be identified from the image, i.e. stomatal north). The angle outputs have been transformed to be within -90 and 90, so that the distribution is centred on 0.