OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
ias_math_compute_vector_length.c
Go to the documentation of this file.
1 /*******************************************************************************
2 NAME: ias_math_compute_vector_length
3 
4 PURPOSE: Find the length of a vector
5 
6 RETURN VALUE
7 TYPE = double
8 Calculated length of the vector
9 
10 *******************************************************************************/
11 #include <math.h>
12 #include "ias_math.h"
13 
15 (
16  const IAS_VECTOR *vec /* I Vector to find the length of */
17 )
18 {
19 
20  /* Calculate the norm */
21  return (sqrt(vec->x * vec->x + vec->y * vec->y + vec->z * vec->z));
22 }
double ias_math_compute_vector_length(const IAS_VECTOR *vec)