Next: 8 Adapting a new terminal
Up: 7 Internal programs
Prev: 7.8 Implementation aids
Contents
REAL FUNCTION RANDOM(I) INTEGER I
On entry:
I < 0: initialization of the generator (we advise abs(I) = "big" first number);
For I 0, we obtain a real number between 0 and 1.
REAL FUNCTION ATANG(Y, X) REAL X, Y
This is the same as function ARC-TANGENT with two arguments, but it does not crash if X and Y equals 0; in this case ATANG(0.,0.) = 0.
The result is a number between 0. and 2*PI.
Y: corresponds to MODULE * SIN(ALPHA);
X: corresponds to MODULE * COS(ALPHA).
SUBROUTINE CXHULL(X, Y, CRITER, REFPTS, NBPTS, HULL, NBHULL) REAL X(NBPTS), Y(NBPTS) REAL CRITER(2, NBPTS) INTEGER NBPTS, REFPTS(NBPTS), HULL(NBPTS), NBHULL
calculates the convex hull of a collection of points .
On entry:
NBPTS, X(NBPTS), Y(NBPTS): definition of the collection of points;
CRITER(2, NBPTS) and REFPTS(NBPTS): the work arrays for the sort.
On exit:
HULL(NBHULL): the convex hull of NBHULL points;
HULL: X and Y references defining the convex hull.
The points in the hull are input by turning in the positive direction.
REAL FUNCTION CPXLIN(X,Y,N,HULL,NBHULL) INTEGER N,NBHULL,HULL(NBHULL) REAL X(N),Y(N)
computes the "complexity" of the polygon X,Y.
CPXLIN= 2*length of the line/perimeter of the convex hull.
On entry:
X, Y: line through N points;
HULL: convex hull of NBHULL points.
On exit:
CPXLIN= 2*length of the line/perimeter of the convex hull.
SUBROUTINE NNUEES(X, Y, Z, N, BX, BY, BZ, NBBARY, CHAINE) INTEGER N, NBBARY, CHAINE(N) REAL X(N), Y(N), Z(N), BX(NBBARY), BY(NBBARY), BZ(NBBARY)
Algorithm for dynamic clusters .
On entry:
N Points X, Y, Z and NBBARY initial barycenters BX, BY, BZ.
On exit:
The NBBARY barycenters found: BX, BY, BZ;
CHAINE(I): which points to the barycenter to which the point X(I), Y(I), Z(I) belongs.
SUBROUTINE BBLOCS(X, Y, Z, N, BX, BY, BZ, NBBARY, CHAINE) INTEGER N, NBBARY, CHAINE(N) REAL X(N), Y(N), Z(N), BX(NBBARY), BY(NBBARY), BZ(NBBARY)
On entry:
N points X, Y, Z and NBBARY, the number of barycenters desired.
On exit:
The NBBARY barycenters found: BX, BY, BZ;
CHAINE(I): which points to the barycenter to which the point X(I), Y(I), Z(I) belongs.
INTEGER FUNCTION ISIGNE(I) INTEGER I
returns 1 if I > 0, 0 if I = 0 or -1 if I < 0.