Euclidean distance between 3D points :param location_1, location_2: 3D points
(location_1, location_2)
| 142 | |
| 143 | |
| 144 | def compute_distance(location_1, location_2): |
| 145 | """ |
| 146 | Euclidean distance between 3D points |
| 147 | |
| 148 | :param location_1, location_2: 3D points |
| 149 | """ |
| 150 | x = location_2.x - location_1.x |
| 151 | y = location_2.y - location_1.y |
| 152 | z = location_2.z - location_1.z |
| 153 | norm = np.linalg.norm([x, y, z]) + np.finfo(float).eps |
| 154 | return norm |
| 155 | |
| 156 | |
| 157 | def positive(num): |
no outgoing calls
no test coverage detected