1 |
– |
/* Copyright (c) 1986 Regents of the University of California */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* genblind2.c - make some curved or flat venetian blinds. |
6 |
|
* |
16 |
|
*/ |
17 |
|
|
18 |
|
#include <stdio.h> |
19 |
+ |
#include <stdlib.h> |
20 |
|
#include <math.h> |
21 |
|
|
22 |
< |
#define PI 3.141592653589793 |
23 |
< |
#define DELTA 5. /* MINIMAL SUSTAINED ANGLE IN DEGREES */ |
22 |
> |
#define PI 3.14159265358979323846 |
23 |
> |
#define DELTA 10. /* MINIMAL SUSTAINED ANGLE IN DEGREES */ |
24 |
|
|
25 |
|
double baseflat[4][3], baseblind[4][3][180]; |
26 |
|
double A[3],X[3]; |
33 |
|
int argc; |
34 |
|
char *argv[]; |
35 |
|
{ |
38 |
– |
double atof(), fabs(); |
36 |
|
double width, delem, depth, rcurv = 0.0, angle; |
37 |
|
double beta, gamma, theta, chi; |
38 |
|
int i, j, k, l; |
49 |
|
angle = atof(argv[7]); |
50 |
|
if (argc == 10) |
51 |
|
if (!strcmp(argv[8], "-r")) |
52 |
< |
rcurv = atof(argv[8]); |
52 |
> |
rcurv = atof(argv[9]); |
53 |
|
else if (!strcmp(argv[8], "+r")) |
54 |
< |
rcurv = -atof(argv[8]); |
54 |
> |
rcurv = -atof(argv[9]); |
55 |
|
else |
56 |
|
goto userr; |
57 |
|
|
65 |
|
|
66 |
|
/* HOW MANY ELEMENTARY SURFACES SHOULD BE CALCULATED ? */ |
67 |
|
|
68 |
< |
nsurf = (theta / ((PI/180.)*DELTA)); |
68 |
> |
nsurf = (theta / ((PI/180.)*DELTA)) + 1; |
69 |
|
|
70 |
|
/* WHAT IS THE DEPTH OF THE ELEMENTARY SURFACES ? */ |
71 |
|
|
149 |
|
makeflat(w,d,a) |
150 |
|
double w, d, a; |
151 |
|
{ |
155 |
– |
double sin(), cos(); |
152 |
|
double h; |
153 |
|
|
154 |
|
h = d*sin(a); |