OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/gfx/vector2d.h" | 5 #include "ui/gfx/geometry/vector2d.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 | 10 |
11 namespace gfx { | 11 namespace gfx { |
12 | 12 |
13 bool Vector2d::IsZero() const { | 13 bool Vector2d::IsZero() const { |
14 return x_ == 0 && y_ == 0; | 14 return x_ == 0 && y_ == 0; |
15 } | 15 } |
(...skipping 14 matching lines...) Expand all Loading... |
30 | 30 |
31 float Vector2d::Length() const { | 31 float Vector2d::Length() const { |
32 return static_cast<float>(std::sqrt(static_cast<double>(LengthSquared()))); | 32 return static_cast<float>(std::sqrt(static_cast<double>(LengthSquared()))); |
33 } | 33 } |
34 | 34 |
35 std::string Vector2d::ToString() const { | 35 std::string Vector2d::ToString() const { |
36 return base::StringPrintf("[%d %d]", x_, y_); | 36 return base::StringPrintf("[%d %d]", x_, y_); |
37 } | 37 } |
38 | 38 |
39 } // namespace gfx | 39 } // namespace gfx |
OLD | NEW |