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

Unified Diff: sdk/lib/html/dartium/html_dartium.dart

Side-by-side diff isn't available for this file because of its large size.
Issue 21619004: Add magnitude getter to Point. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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:
Download patch
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tests/html/point_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dartium/html_dartium.dart
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index 555a0d096add4228a1103dd1d6107c04a630c765..647928e299ebaf985fa042fc44de35b717488694 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -30691,6 +30691,12 @@ class Point {
}
/**
+ * Get the straight line (Euclidean) distance between the origin (0, 0) and
+ * this point.
+ */
+ num get magnitude => sqrt(x * x + y * y);
+
+ /**
* Returns the distance between two points.
*/
double distanceTo(Point other) {
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tests/html/point_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698