PointVector class
- Inheritance
-
- Object
- OffsetBase
- Offset
- PointVector
- Implementers
Constructors
- PointVector(double x, double y, [double? pressure])
-
const
- PointVector.fromOffset({required Offset offset, double? pressure})
Properties
- direction → double
-
The angle of this offset as radians clockwise from the positive x-axis, in
the range -pi to pi, assuming positive values of the x-axis go to the
right and positive values of the y-axis go down.
no setterinherited
- distance → double
-
The magnitude of the offset.
no setterinherited
- distanceSquared → double
-
The square of the magnitude of the offset.
no setterinherited
- dx → double
-
The x component of the offset.
no setterinherited
- dy → double
-
The y component of the offset.
no setterinherited
- hashCode → int
-
Returns a hash of the x and y values.
This matches the hashcode of an Offset with those same values.
no setteroverride
- isFinite → bool
-
Whether both components are finite (neither infinite nor NaN).
no setterinherited
- isInfinite → bool
-
Returns true if either component is double.infinity, and false if both
are finite (or negative infinity, or NaN).
no setterinherited
- p → double
-
Deprecated non-nullable pressure value.
no setter
- pressure → double?
-
The pressure of the point, between 0 and 1,
or null if the pressure is unknown.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- x → double
-
Identical to dx
final
- y → double
-
Identical to dy
final
Methods
-
copyWith(
{double? x, double? y, double? pressure}) → PointVector -
distanceSquaredTo(
PointVector point) → double -
distanceTo(
PointVector point) → double -
dpr(
PointVector other) → double - Dot product
-
lerp(
double t, PointVector other) → PointVector -
Linearly interpolate between two offsets.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
perpendicular(
) → PointVector - Perpendicular rotation of the vector
-
project(
PointVector direction, double distance) → PointVector -
Project this point in the direction of
direction
by a scalardistance
. -
rotAround(
PointVector center, double r) → PointVector -
Rotate a vector around another vector by
r
radians -
scale(
double scaleX, double scaleY) → Offset -
Returns a new offset with the x component scaled by
scaleX
and the y component scaled byscaleY
.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
translate(
double translateX, double translateY) → Offset -
Returns a new offset with translateX added to the x component and
translateY added to the y component.
inherited
-
unit(
) → PointVector - Get the normalized / unit vector.
-
unitVectorTo(
PointVector other) → PointVector
Operators
-
operator %(
double operand) → Offset -
Modulo (remainder) operator.
inherited
-
operator &(
Size other) → Rect -
Rectangle constructor operator.
inherited
-
operator *(
double operand) → PointVector -
Multiplication operator.
override
-
operator +(
Offset other) → PointVector -
Binary addition operator.
override
-
operator -(
Offset other) → PointVector -
Binary subtraction operator.
override
-
operator /(
double operand) → Offset -
Division operator.
inherited
-
operator <(
OffsetBase other) → bool -
Less-than operator. Compares an Offset or Size to another Offset or
Size, and returns true if both the horizontal and vertical values of the
left-hand-side operand are smaller than the horizontal and vertical values
of the right-hand-side operand respectively. Returns false otherwise.
inherited
-
operator <=(
OffsetBase other) → bool -
Less-than-or-equal-to operator. Compares an Offset or Size to another
Offset or Size, and returns true if both the horizontal and vertical
values of the left-hand-side operand are smaller than or equal to the
horizontal and vertical values of the right-hand-side operand
respectively. Returns false otherwise.
inherited
-
operator ==(
Object other) → bool -
Compares this PointVector to an Offset or PointVector
other
for equality.override -
operator >(
OffsetBase other) → bool -
Greater-than operator. Compares an Offset or Size to another Offset
or Size, and returns true if both the horizontal and vertical values of
the left-hand-side operand are bigger than the horizontal and vertical
values of the right-hand-side operand respectively. Returns false
otherwise.
inherited
-
operator >=(
OffsetBase other) → bool -
Greater-than-or-equal-to operator. Compares an Offset or Size to
another Offset or Size, and returns true if both the horizontal and
vertical values of the left-hand-side operand are bigger than or equal to
the horizontal and vertical values of the right-hand-side operand
respectively. Returns false otherwise.
inherited
-
operator unary-(
) → PointVector -
Negates the vector.
override
-
operator ~/(
double operand) → Offset -
Integer (truncating) division operator.
inherited
Constants
- one → const PointVector
- zero → const PointVector