The** tregenzadist** function determines the nearest neighbour patches and the angular distance to a given tregenza hemisphere patch.

Usage:

[p,d] = tregenzadist(patch,n,not)

Where:

Parameter | Description |

`p` | Is a vector containing the nearest neighbour patches in ascending order. |

`d` | Is a vector containing the corresponing angular distance to the given patch in ascending order. |

`patch` | Defines the Tregenza patch on the hemisphere, scalar. |

`n` | Defines the number of returned patches, scalar. Maximum value = 144. |

`not` | Defines patches that should be excluded, vector. |

**Examples**

**Determine the 6 nearest neighbours in ascending order of Tregenza patch 35:**

tregenzadist(35,6)

Result:

ans = 34 36 26 81 25 27

**Determine the 6 nearest neighbours in ascending order of Tregenza patch 35 excluding patch 36:**

tregenzadist(35,6,36) plottregenza(1:145,'w')

See also: plottregenza

Result:

ans = 34 26 81 25 27 80

**Determine the 5 nearest neighbours in ascending order of Tregenza patch 118 and the according angular distance:**

[p,d] = tregenzadist(118,5)

See also: plottregenza

Result:

p = 117 119 96 132 95 d = 11.716 11.716 12.000 12.000 15.578

**Reference:**

`Subdivision of the sky hemisphere for luminance measurements. In: Lighting Research and Technology, vol. 19, no. 1, pp. 13-14, 1987, (DOI: 10.1177/096032718701900103).`