GRASS 8 Programmer's Manual
8.6.0dev(2026)-1d1e47ad9d
Loading...
Searching...
No Matches
ortho.c
Go to the documentation of this file.
1
/* ortho.c CCMATH mathematics library source code.
2
*
3
* Copyright (C) 2000 Daniel A. Atkinson All rights reserved.
4
* This code may be redistributed under the terms of the GNU library
5
* public license (LGPL). ( See the lgpl.license file for details.)
6
* ------------------------------------------------------------------------
7
*/
8
#include "
ccmath.h
"
9
static
double
tpi = 6.28318530717958647;
10
11
void
ortho
(
double
*e,
int
n)
12
{
13
int
i,
j
, k,
m
;
14
15
double
*p, *q, c, s, a,
unfl
(
void
);
16
17
for
(i = 0, p = e; i < n; ++i) {
18
for
(
j
= 0;
j
< n; ++
j
) {
19
if
(i ==
j
)
20
*p++ = 1.;
21
else
22
*p++ = 0.;
23
}
24
}
25
for
(i = 0,
m
= n - 1; i <
m
; ++i) {
26
for
(
j
= i + 1;
j
< n; ++
j
) {
27
a = tpi *
unfl
();
28
c =
cos
(a);
29
s =
sin
(a);
30
p = e + n * i;
31
q = e + n *
j
;
32
for
(k = 0; k < n; ++k) {
33
a = *p * c + *q * s;
34
*q = *q * c - *p * s;
35
*p++ = a;
36
++q;
37
}
38
}
39
}
40
}
ccmath.h
AMI_STREAM
Definition
ami_stream.h:153
ortho
void ortho(double *e, int n)
Definition
ortho.c:11
unfl
double unfl(void)
Definition
unfl.c:10
lib
external
ccmath
ortho.c
Generated on Fri Apr 3 2026 06:59:52 for GRASS 8 Programmer's Manual by
1.9.8