Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1374)

Unified Diff: ui/gfx/vector2d_f.cc

Issue 11369043: ui: Create the gfx::QuadF class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« ui/gfx/vector2d_f.h ('K') | « ui/gfx/vector2d_f.h ('k') | ui/ui.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/vector2d_f.cc
diff --git a/ui/gfx/vector2d_f.cc b/ui/gfx/vector2d_f.cc
index f628421269ca2c1b668c8c720f72ff7a8dc0c728..3671c62869c6a7fc3e4c39471b1c71294c5dcf70 100644
--- a/ui/gfx/vector2d_f.cc
+++ b/ui/gfx/vector2d_f.cc
@@ -51,4 +51,14 @@ void Vector2dF::Scale(float x_scale, float y_scale) {
y_ *= y_scale;
}
+double CrossProduct(const Vector2dF& lhs, const Vector2dF& rhs) {
+ return static_cast<double>(lhs.x()) * rhs.y() -
+ static_cast<double>(lhs.y()) * rhs.x();
+}
+
+double DotProduct(const Vector2dF& lhs, const Vector2dF& rhs) {
+ return static_cast<double>(lhs.x()) * rhs.x() +
+ static_cast<double>(lhs.y()) * rhs.y();
+}
+
} // namespace gfx
« ui/gfx/vector2d_f.h ('K') | « ui/gfx/vector2d_f.h ('k') | ui/ui.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698