Movatterモバイル変換


[0]ホーム

URL:


menu
  1. Dart
  2. dart:math
  3. Point<T extendsnum> class
Point
description

Point<T extends num> class

A utility class for representing two-dimensional positions.

Example:

var leftTop = const Point(0, 0);var rightBottom = const Point(200, 400);

Legacy: New usages ofPoint are discouraged.

  • If you are using thePoint class withdart:html,we recommend migrating topackage:web.To learn how and why to migrate,check out themigration guide.
  • If you want to combine anx andy coordinate,consider using arecord.Depending on how you will use it, this could looklikevar point = (x, y) orvar point = (x: x, y: y).
  • If you want to perform vector operations,like vector addition or scalar multiplication,consider using a dedicated vector math library,such aspackage:vector_math.
  • If you are developing a Flutter application or package,consider using theOffsettype fromdart:ui.

Constructors

Point(Tx,Ty)
Creates a point with the providedx andy coordinates.
const

Properties

hashCodeint
The hash code for this object.
no setteroverride
magnitudedouble
Get the straight line (Euclidean) distance between the origin (0, 0) andthis point.
no setter
runtimeTypeType
A representation of the runtime type of the object.
no setterinherited
x→ T
final
y→ T
final

Methods

distanceTo(Point<T>other)double
Returns the distance betweenthis andother.
noSuchMethod(Invocationinvocation)→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
squaredDistanceTo(Point<T>other)→ T
Returns the squared distance betweenthis andother.
toString()String
A string representation of this object.
override

Operators

operator *(numfactor)Point<T>
Scale this point byfactor as if it were a vector.
operator +(Point<T>other)Point<T>
Addother tothis, as if both points were vectors.
operator -(Point<T>other)Point<T>
Subtractother fromthis, as if both points were vectors.
operator ==(Objectother)bool
Whetherother is a point with the same coordinates as this point.
override
  1. Dart
  2. dart:math
  3. Point<T extendsnum> class
dart:math library

[8]ページ先頭

©2009-2025 Movatter.jp