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

Side by Side Diff: third_party/WebKit/Source/platform/geometry/FloatPoint3D.cpp

Issue 2392543003: reflow comments in platform/geometry (Closed)
Patch Set: Created 4 years, 2 months 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <wildfox@kde.org> 2 Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <wildfox@kde.org>
3 2004, 2005 Rob Buis <buis@kde.org> 3 2004, 2005 Rob Buis <buis@kde.org>
4 2005 Eric Seidel <eric@webkit.org> 4 2005 Eric Seidel <eric@webkit.org>
5 5
6 This library is free software; you can redistribute it and/or 6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public 7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either 8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version. 9 version 2 of the License, or (at your option) any later version.
10 10
(...skipping 25 matching lines...) Expand all
36 m_z /= tempLength; 36 m_z /= tempLength;
37 } 37 }
38 } 38 }
39 39
40 float FloatPoint3D::angleBetween(const FloatPoint3D& y) const { 40 float FloatPoint3D::angleBetween(const FloatPoint3D& y) const {
41 float xLength = this->length(); 41 float xLength = this->length();
42 float yLength = y.length(); 42 float yLength = y.length();
43 43
44 if (xLength && yLength) { 44 if (xLength && yLength) {
45 float cosAngle = this->dot(y) / (xLength * yLength); 45 float cosAngle = this->dot(y) / (xLength * yLength);
46 // Due to round-off |cosAngle| can have a magnitude greater than 1. Clamp t he value to [-1, 46 // Due to round-off |cosAngle| can have a magnitude greater than 1. Clamp
47 // 1] before computing the angle. 47 // the value to [-1, 1] before computing the angle.
48 return acos(clampTo(cosAngle, -1.0, 1.0)); 48 return acos(clampTo(cosAngle, -1.0, 1.0));
49 } 49 }
50 return 0; 50 return 0;
51 } 51 }
52 52
53 String FloatPoint3D::toString() const { 53 String FloatPoint3D::toString() const {
54 return String::format("%lg,%lg,%lg", x(), y(), z()); 54 return String::format("%lg,%lg,%lg", x(), y(), z());
55 } 55 }
56 56
57 } // namespace blink 57 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/geometry/FloatPoint3D.h ('k') | third_party/WebKit/Source/platform/geometry/FloatPolygon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698