| 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 |
< |
#ifndef atof |
| 23 |
< |
extern double atof(); |
| 26 |
< |
#endif |
| 22 |
> |
#define PI 3.14159265358979323846 |
| 23 |
> |
#define DELTA 10. /* MINIMAL SUSTAINED ANGLE IN DEGREES */ |
| 24 |
|
|
| 28 |
– |
#define PI 3.141592653589793 |
| 29 |
– |
#define DELTA 5. /* MINIMAL SUSTAINED ANGLE IN DEGREES */ |
| 30 |
– |
|
| 25 |
|
double baseflat[4][3], baseblind[4][3][180]; |
| 26 |
|
double A[3],X[3]; |
| 27 |
|
char *material, *name; |
| 33 |
|
int argc; |
| 34 |
|
char *argv[]; |
| 35 |
|
{ |
| 42 |
– |
double fabs(); |
| 36 |
|
double width, delem, depth, rcurv = 0.0, angle; |
| 37 |
|
double beta, gamma, theta, chi; |
| 38 |
|
int i, j, k, l; |
| 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 |
|
{ |
| 159 |
– |
double sin(), cos(); |
| 152 |
|
double h; |
| 153 |
|
|
| 154 |
|
h = d*sin(a); |