OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
GEO_vec_length3.c
Go to the documentation of this file.
1 /* file: GEO_vec_length3.c */
2 
3 #include "GEO_basic.h"
4 #include "GEO_util.h"
5 
7  double vec[3],
8  double * const length
9  )
10 {
11 /*
12 !C*****************************************************************************
13 !Description: subroutine in the utility functions of the Level-1A geolocation
14  software to calculate the length of a 3 element vector.
15 
16 !Input Parameters:
17  double vec - a three element vector
18 
19 !Output Parameters:
20  double *length - the length of the three element vector
21 
22 !Revision History:
23  $Log: GEO_vec_length3.c,v $
24  Revision 1.4 1997/07/21 16:24:34 kuyper
25  Baselined Version 1
26 
27  * Revision 1.4 1997/03/26 18:16:39 fhliang
28  * Initial revision of SDST delivery of GEO_vec_length3.c.
29  *
30  Revision 1.3 1996/07/24 21:47:10 kuyper
31  Changed to return void.
32  Declared arguments const.
33  Inserted required '!'s in comments.
34  Converted constants to double, to skip implied conversion.
35 
36  Revision 1.2 1996/07/18 21:25:35 kuyper
37  Included self-checking header file.
38 
39 
40  4/5/95
41  Ruiming Chen
42  Finished coding.
43 
44  6/12/95
45  Frederick S. Patt (patt@modis-xl.gsfc.nasa.gov)
46  Revised prolog
47 
48 !Team-unique Header:
49  This software is developed by the MODIS Science Data Support
50  Team for the National Aeronautics and Space Administration,
51  Goddard Space Flight Center, under contract NAS5-32373.
52 
53 !END*************************************************************************
54 */
55 
56  int i = 0; /* iteration parameter */
57 
58  *length = 0.0;
59  for (i = 0; i < 3; ++i)
60  *length = *length + vec[i] * vec[i];
61 
62  *length = sqrt(*length);
63 
64 
65  return;
66 }
void GEO_vec_length3(double vec[3], double *const length)
int i
Definition: decode_rs.h:71