1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
//
// GENERATED FILE
//
use super::*;
use crate::SpiceContext;
use f2rust_std::*;
/// Is a vector the zero vector?
///
/// Indicate whether a 3-vector is the zero vector.
///
/// # Brief I/O
///
/// ```text
/// VARIABLE I/O DESCRIPTION
/// -------- --- --------------------------------------------------
/// V I Vector to be tested.
///
/// The function returns the value .TRUE. if and only if V is the
/// zero vector.
/// ```
///
/// # Detailed Input
///
/// ```text
/// V is a vector in 3-space.
/// ```
///
/// # Detailed Output
///
/// ```text
/// The function returns the value .TRUE. if and only if V is the
/// zero vector.
/// ```
///
/// # Exceptions
///
/// ```text
/// Error free.
/// ```
///
/// # Particulars
///
/// ```text
/// This function has the same truth value as the logical expression
///
/// VNORM ( V ) .EQ. 0.D0
///
/// Replacing the above expression by
///
/// VZERO ( V )
///
/// has several advantages: the latter expresses the test more
/// clearly, looks better, and doesn't go through the work of scaling,
/// squaring, taking a square root, and re-scaling (all of which
/// VNORM must do) just to find out that a vector is non-zero.
///
/// A related function is VZEROG, which accepts vectors of arbitrary
/// dimension.
/// ```
///
/// # Examples
///
/// ```text
/// 1) When testing whether a vector is the zero vector, one
/// normally constructs tests like
///
/// IF ( VNORM ( V ) .EQ. 0.D0 ) THEN
/// .
/// .
/// .
///
///
/// These can be replaced with the code
///
/// IF ( VZERO ( V ) ) THEN
/// .
/// .
/// .
///
///
/// 2) Check that a normal vector is non-zero before creating
/// a plane with PNV2PL:
///
/// IF ( VZERO ( NORMAL ) ) THEN
///
/// [ handle error ]
///
/// ELSE
///
/// CALL PNV2PL ( POINT, NORMAL, PLANE )
/// .
/// .
/// .
/// ```
///
/// # Author and Institution
///
/// ```text
/// N.J. Bachman (JPL)
/// J. Diaz del Rio (ODC Space)
/// W.L. Taber (JPL)
/// I.M. Underwood (JPL)
/// ```
///
/// # Version
///
/// ```text
/// - SPICELIB Version 1.1.0, 05-JUL-2021 (JDR)
///
/// Added IMPLICIT NONE statement.
///
/// Edited the header to comply with NAIF standard.
///
/// - SPICELIB Version 1.0.1, 10-MAR-1992 (WLT)
///
/// Comment section for permuted index source lines was added
/// following the header.
///
/// - SPICELIB Version 1.0.0, 17-JUL-1990 (NJB) (IMU)
/// ```
pub fn vzero(v: &[f64; 3]) -> bool {
let ret = VZERO(v);
ret
}
//$Procedure VZERO ( Is a vector the zero vector? )
pub fn VZERO(V: &[f64]) -> bool {
let V = DummyArray::new(V, 1..=3);
let mut VZERO: bool = false;
//
// `Just do it'.
//
//
VZERO = (((V[1] == 0.0) && (V[2] == 0.0)) && (V[3] == 0.0));
VZERO
}