Commit 5da45ee
committed
Fix cos_alpha computation in TTC formula
cos_alpha should be the dot product of the unit position difference
(e_v) and the unit relative velocity (v_rel_hat). Previously, it was
divided by (distance * v_rel_norm), which introduced a spurious 1/d
factor since e_v was already a unit vector.
Also rename v_rel_norm to delta_v_norm to clarify it is the magnitude
of the actual relative velocity (used in the TTC denominator), not the
norm of the unit vector.1 parent d11587f commit 5da45ee
1 file changed
Lines changed: 6 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
| 119 | + | |
119 | 120 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
| 121 | + | |
| 122 | + | |
124 | 123 | | |
125 | 124 | | |
126 | 125 | | |
127 | | - | |
128 | | - | |
129 | 126 | | |
130 | 127 | | |
131 | 128 | | |
| |||
138 | 135 | | |
139 | 136 | | |
140 | 137 | | |
141 | | - | |
| 138 | + | |
142 | 139 | | |
143 | 140 | | |
144 | 141 | | |
145 | 142 | | |
146 | 143 | | |
147 | | - | |
| 144 | + | |
148 | 145 | | |
149 | 146 | | |
150 | 147 | | |
| |||
0 commit comments