Spec-Zone.ru › Dart 2

dart:math

magnitude property

double magnitude

Get the straight line (Euclidean) distance between the origin (0, 0) and this point.

Example:

var magnitude = const Point(0, 0).magnitude; // 0.0
magnitude = const Point(10, 0).magnitude;  // 10.0
magnitude = const Point(0, -10).magnitude; // 10.0
magnitude = const Point(10, 10).magnitude;  // 14.142135623730951

Implementation

double get magnitude => sqrt(x * x + y * y);

© 2012 the Dart project authors
Licensed under the BSD 3-Clause "New" or "Revised" License.
https://api.dart.dev/stable/2.19.6/dart-math/Point/magnitude.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API