122 |
|
FVECT vres, vorig, vnorm; |
123 |
|
double theta; |
124 |
|
{ |
125 |
< |
extern double sin(), cos(); |
126 |
< |
double sint, cost, dotp; |
125 |
> |
extern double cos(), sin(); |
126 |
> |
double sint, cost, normprod; |
127 |
|
FVECT vperp; |
128 |
|
register int i; |
129 |
|
|
130 |
|
if (theta == 0.0) { |
131 |
< |
VCOPY(vres, vorig); |
131 |
> |
if (vres != vorig) |
132 |
> |
VCOPY(vres, vorig); |
133 |
|
return; |
134 |
|
} |
134 |
– |
sint = sin(theta); |
135 |
|
cost = cos(theta); |
136 |
< |
dotp = DOT(vorig, vnorm); |
136 |
> |
sint = sin(theta); |
137 |
> |
normprod = DOT(vorig, vnorm)*(1.-cost); |
138 |
|
fcross(vperp, vnorm, vorig); |
139 |
|
for (i = 0; i < 3; i++) |
140 |
< |
vres[i] = vnorm[i]*dotp*(1.-cost) + |
140 |
< |
vorig[i]*cost + vperp[i]*sint; |
140 |
> |
vres[i] = vorig[i]*cost + vnorm[i]*normprod + vperp[i]*sint; |
141 |
|
} |