diff --git a/webrtc/modules/audio_processing/beamformer/array_util.h b/webrtc/modules/audio_processing/beamformer/array_util.h index 8d1cda783..f7598c0b5 100644 --- a/webrtc/modules/audio_processing/beamformer/array_util.h +++ b/webrtc/modules/audio_processing/beamformer/array_util.h @@ -23,19 +23,13 @@ struct CartesianPoint { c[1] = y; c[2] = z; } - T x() const { - return c[0]; - } - T y() const { - return c[1]; - } - T z() const { - return c[2]; - } + T x() const { return c[0]; } + T y() const { return c[1]; } + T z() const { return c[2]; } T c[3]; }; -typedef CartesianPoint Point; +using Point = CartesianPoint; template float Distance(CartesianPoint a, CartesianPoint b) { @@ -44,6 +38,21 @@ float Distance(CartesianPoint a, CartesianPoint b) { (a.z() - b.z()) * (a.z() - b.z())); } +template +struct SphericalPoint { + SphericalPoint(T azimuth, T elevation, T radius) { + s[0] = azimuth; + s[1] = elevation; + s[2] = radius; + } + T azimuth() const { return s[0]; } + T elevation() const { return s[1]; } + T distance() const { return s[2]; } + T s[3]; +}; + +using SphericalPointf = SphericalPoint; + } // namespace webrtc #endif // WEBRTC_MODULES_AUDIO_PROCESSING_BEAMFORMER_ARRAY_UTIL_H_