Chromium Code Reviews| Index: webrtc/modules/audio_processing/beamformer/array_util.h |
| diff --git a/webrtc/modules/audio_processing/beamformer/array_util.h b/webrtc/modules/audio_processing/beamformer/array_util.h |
| index 2ac174ea8aa04800995551d03017c9d215415921..1291ba90968decdce534bbb9b3ab86a43882d2ff 100644 |
| --- a/webrtc/modules/audio_processing/beamformer/array_util.h |
| +++ b/webrtc/modules/audio_processing/beamformer/array_util.h |
| @@ -16,7 +16,12 @@ |
| namespace webrtc { |
| -// Coordinates in meters. |
| +// Coordinates in meters. The convention used is: |
| +// x: the horizontal dimension, with positive to the right from the camera's |
| +// perspective. |
| +// y: the depth dimension, with positive forward from the camera's |
| +// perspective. |
| +// z: the vertical dimension, with positive upwards. |
| template<typename T> |
| struct CartesianPoint { |
| CartesianPoint(T x, T y, T z) { |
| @@ -43,6 +48,11 @@ float Distance(CartesianPoint<T> a, CartesianPoint<T> b) { |
| (a.z() - b.z()) * (a.z() - b.z())); |
| } |
| +// The convention used: |
| +// azimuth: zero is to the right from the camera's perspective, with positive |
| +// angles in radians counter-clockwise. |
| +// elevation: zero is horizontal, with positive angles in radians upwards. |
| +// radius: distance from the camera in meters. |
| template <typename T> |
| struct SphericalPoint { |
| SphericalPoint(T azimuth, T elevation, T radius) { |
| @@ -58,6 +68,10 @@ struct SphericalPoint { |
| using SphericalPointf = SphericalPoint<float>; |
| +// Helper functions to transform degrees to radians and the inverse. |
| +float DegreesToRadians(float angle_degrees); |
|
Andrew MacDonald
2015/10/21 03:27:43
Probably reasonable to make these templates.
aluebs-webrtc
2015/10/27 18:08:15
Done.
|
| +float RadiansToDegrees(float angle_radians); |
| + |
| } // namespace webrtc |
| #endif // WEBRTC_MODULES_AUDIO_PROCESSING_BEAMFORMER_ARRAY_UTIL_H_ |