diff options
author | 2013-01-21 01:58:55 -0800 | |
---|---|---|
committer | 2013-01-21 01:58:55 -0800 | |
commit | 82deebe0d9d647951c95e67aef6b4b97ab6f4c52 (patch) | |
tree | 5a06bbbcaa048183dd4aba18643f16b500a7be08 /native/jni/src/geometry_utils.h | |
parent | 1ab8cdbe32314c17192836abae77411d628a6a86 (diff) | |
parent | 26a0c628b0723b2c6b7700eb0b3af3548cf312b7 (diff) | |
download | latinime-82deebe0d9d647951c95e67aef6b4b97ab6f4c52.tar.gz latinime-82deebe0d9d647951c95e67aef6b4b97ab6f4c52.tar.xz latinime-82deebe0d9d647951c95e67aef6b4b97ab6f4c52.zip |
am 26a0c628: Merge "refactor proximity info"
* commit '26a0c628b0723b2c6b7700eb0b3af3548cf312b7':
refactor proximity info
Diffstat (limited to 'native/jni/src/geometry_utils.h')
-rw-r--r-- | native/jni/src/geometry_utils.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/native/jni/src/geometry_utils.h b/native/jni/src/geometry_utils.h index 64bbbd4b8..4cbb127e8 100644 --- a/native/jni/src/geometry_utils.h +++ b/native/jni/src/geometry_utils.h @@ -44,5 +44,10 @@ static AK_FORCE_INLINE float getAngleDiff(const float a1, const float a2) { } return diff; } + +static AK_FORCE_INLINE int getDistanceInt(const int x1, const int y1, const int x2, + const int y2) { + return static_cast<int>(hypotf(static_cast<float>(x1 - x2), static_cast<float>(y1 - y2))); +} } // namespace latinime #endif // LATINIME_GEOMETRY_UTILS_H |