ExpressivePoint class
A point, or a vector, in two dimensions.
- Annotations
Constructors
- ExpressivePoint(double x, double y)
-
A point at (
x,y).const
Properties
- angleDegrees → double
-
The angle of this vector from the x axis, in degrees.
no setter
- angleRadians → double
-
The angle of this point from the positive x axis, in radians.
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- x → double
-
The x coordinate.
final
- y → double
-
The y coordinate.
final
Methods
-
clockwise(
ExpressivePoint other) → bool - Compute the Z coordinate of the cross product of two vectors, to check if the second vector is going clockwise ( > 0 ) or counterclockwise (< 0) compared with the first one. It could also be 0, if the vectors are co-linear.
-
copy(
) → ExpressivePoint - A copy of this point.
-
dotProduct(
ExpressivePoint other) → double -
The dot product of this point and
other. -
dotProductXY(
double otherX, double otherY) → double -
The dot product of this point and the point (
otherX,otherY). -
getDirection(
) → ExpressivePoint - This point divided by its distance from the origin.
-
getDistance(
) → double - The magnitude of the ExpressivePoint, which is the distance of this point from (0, 0).
-
getDistanceSquared(
) → double - The square of the magnitude (which is the distance of this point from (0, 0)) of the ExpressivePoint.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
rotate(
double degrees, {ExpressivePoint center = ExpressivePoint.zero}) → ExpressivePoint -
This point turned by
degreesaboutcenter. -
rotate90(
) → ExpressivePoint - This point turned a quarter turn about the origin.
-
scale(
double sx, double sy) → ExpressivePoint -
This point with x multiplied by
sxand y bysy. -
toString(
) → String -
A string representation of this object.
override
-
transformed(
ExpressivePointTransformer f) → ExpressivePoint -
The point
fmoves this point to. -
translate(
double dx, double dy) → ExpressivePoint -
This point moved by
dxalong x anddyalong y.
Operators
-
operator %(
double operand) → ExpressivePoint - Modulo (remainder) operator.
-
operator *(
double operand) → ExpressivePoint - Multiplication operator.
-
operator +(
ExpressivePoint operand) → ExpressivePoint - Binary addition operator.
-
operator -(
ExpressivePoint operand) → ExpressivePoint - Binary subtraction operator.
-
operator /(
double operand) → ExpressivePoint - Division operator.
-
operator ==(
Object other) → bool -
The equality operator.
override
-
operator unary-(
) → ExpressivePoint - Unary negation operator.
Constants
- zero → const ExpressivePoint
- The point (0, 0).