An immutable 2D floating-point x,y coordinate pair.

A Point represents a specific position in Cartesian space.

Subtracting a point from another returns the Offset that represents the vector between the two points.

Constants

origin Point

The point at the origin, (0, 0).

const Point(0.0, 0.0)

Static Methods

lerp(Point a, Point b, double t) Point

Linearly interpolate between two points.

Constructors

Point(double x, double y)

Creates a point. The first argument sets x, the horizontal component, and the second sets y, the vertical component.

const

Properties

hashCode int

read-only
x double

The horizontal component of the point.

read-only
y double

The vertical component of the point.

read-only
runtimeType Type

A representation of the runtime type of the object.

read-only, inherited

Operators

operator %(double operand) Point

Modulo (remainder) operator. Returns a point whose coordinates are the remainder of the coordinates of the left-hand-side operand (a point) divided by the scalar right-hand-side operand (a double).

operator &(Size other) Rect

Rectangle constructor operator. Combines a point and a Size to form a Rect whose top-left coordinate is this point, the left-hand-side operand, and whose size is the right-hand-side operand.

operator *(double operand) Point

Multiplication operator. Returns a point whose coordinates are the coordinates of the left-hand-side operand (a Point) multiplied by the scalar right-hand-side operand (a double).

operator +(Offset other) Point

Binary addition operator. Returns a point that is this point (the left-hand-side operand) plus a vector Offset (the right-hand-side operand).

operator -(Point other) Offset

Binary subtraction operator. Returns an Offset representing the direction and distance from the other point (the right-hand-side operand) to this point (the left-hand-side operand).

operator /(double operand) Point

Division operator. Returns a point whose coordinates are the coordinates of the left-hand-side operand (a point) divided by the scalar right-hand-side operand (a double).

operator ==(other) bool

The equality operator.

operator unary-() Point

Unary negation operator. Returns a point with the coordinates negated.

operator ~/(double operand) Point

Integer (truncating) division operator. Returns a point whose coordinates are the coordinates of the left-hand-side operand (a point) divided by the scalar right-hand-side operand (a double), rounded towards zero.

Methods

toOffset() Offset

Converts this point to an Offset with the same coordinates.

toString() String

Returns a string representation of this object.

noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited