Point class
Constructors
Point (double x , double y , [bool ? round ])
Creates a Point object with the given x and y coordinates. If optional round is set to true, rounds the x and y values.
Point.fromCoords (List coords )
Expects an array of the form x, y
instead.
Properties
hashCode
→ int
The hash code for this object.
no setter inherited
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
x
↔ double
The x coordinate of the point
getter/setter pair
y
↔ double
The y coordinate of the point
getter/setter pair
Methods
add (Point otherPoint )
→ Point
Returns the result of addition of the current and the given points.
ceil ()
→ Point
Returns a copy of the current point with ceiled coordinates (rounded up).
clone ()
→ Point
Returns a copy of the current point.
contains (Point otherPoint )
→ bool
Returns true if both coordinates of the given point are less than the corresponding current point coordinates (in absolute values).
distanceTo (Point ? otherPoint )
→ double
Returns the cartesian distance between the current and the given points.
divideBy (double num )
→ Point
Returns the result of division of the current point by the given number.
equals (Point otherPoint )
→ bool
Returns true if the given point has the same coordinates.
floor ()
→ Point
Returns a copy of the current point with floored coordinates (rounded down).
multiplyBy (double num )
→ Point
Returns the result of multiplication of the current point by the given number.
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
round ()
→ Point
Returns a copy of the current point with rounded coordinates.
scaleBy (Point scale )
→ Point
Multiply each coordinate of the current point by each coordinate of scale. In linear algebra terms, multiply the point by the scaling matrix defined by scale.
subtract (Point otherPoint )
→ Point
Returns the result of subtraction of the given point from the current.
toString ()
→ String
Returns a string representation of the point for debugging purposes.
override
trunc ()
→ Point
Returns a copy of the current point with truncated coordinates (rounded towards zero).
unscaleBy (Point scale )
→ Point
Inverse of scaleBy. Divide each coordinate of the current point by each coordinate of scale.