Point<T extends num> class
Null safety
- Implemented types
-
- Point<
T>
- Point<
Constructors
- Point(T x, T y)
-
Point.from(Point<
T> p)
Properties
- hashCode → int
-
The hash code for this object. [...]
read-only, override
- magnitude → double
-
Get the straight line (Euclidean) distance between the
origin (0, 0) and this point.
read-only, override
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
- x ↔ T
-
read / write, override-getter
- y ↔ T
-
read / write, override-getter
Methods
-
clone(
) → Point< T> -
copyFrom(
Point< T> point) → void - Copies the coordinates from another Point into this Point.
-
distanceTo(
Point< T> other) → double -
Returns the distance between
this
andother
.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
offset(
T dx, T dy) → void - Offsets this Point by the specified amount.
-
setTo(
T px, T py) → void - Sets the coordinates of this Point to the specified values.
-
squaredDistanceTo(
Point< T> other) → T -
Returns the squared distance between
this
andother
. [...]override -
toString(
) → String -
A string representation of this object. [...]
override
Operators
-
operator *(
num factor) → Point< T> -
Scale this point by
factor
as if it were a vector. [...]override -
operator +(
Point< T> other) → Point<T> -
Add
other
tothis
, as if both points were vectors. [...]override -
operator -(
Point< T> other) → Point<T> -
Subtract
other
fromthis
, as if both points were vectors. [...]override -
operator ==(
Object other) → bool -
A
Point
is only equal to anotherPoint
with the same coordinates. [...]override