Vector2 class

Constructors

Vector2(double x, double y)
Vector2.copy(Vector2 other)
Vector2.fromAngle(double angle, [double magnitude = 1.0])
Vector2.fromJson(Map<String, dynamic> json)
factory
Vector2.one()
Vector2.zero()

Properties

angle double
no setter
hashCode int
The hash code for this object.
no setteroverride
isZero bool
no setter
magnitude double
no setter
magnitudeSquared double
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
x double
getter/setter pair
y double
getter/setter pair

Methods

clamp(double maxLength) → void
clamped(double maxLength) Vector2
clone() Vector2
cross(Vector2 other) double
distanceSquaredTo(Vector2 other) double
distanceTo(Vector2 other) double
dot(Vector2 other) double
lerp(Vector2 other, double t) Vector2
normalize() → void
normalized() Vector2
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reflect(Vector2 normal) → void
reflected(Vector2 normal) Vector2
rotate(double angle) → void
rotated(double angle) Vector2
set(double newX, double newY) → void
setFrom(Vector2 other) → void
toJson() Map<String, double>
toString() String
A string representation of this object.
override

Operators

operator *(Object other) Vector2
operator +(Object other) Vector2
operator -(Object other) Vector2
operator /(Object other) Vector2
operator ==(Object other) bool
The equality operator.
override
operator unary-() Vector2