frudawski

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:

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')

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)

Result:

 p =

117
119
96
132
95

d =

11.716
11.716
12.000
12.000
15.578

Reference:

Peter Roy Tregenza: 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).