Point基本信息
使用Point类需要导入Import “dart:math”.
类的声明格式 Point class
该类的作用:A utility class for representing two-dimensional positions.
构造函数Constructors
Point(T x T y)
const
属性Properties
hashCode → int ,The hash code for this object. read-only, override
magnitude → double, Get the straight line (Euclidean) distance between the origin (0, 0) and this point. read-only
x → T ,final
y → T, final
runtimeType → Type ,A representation of the runtime type of the object.read-only, inherited ,
方法Methods
distanceTo(Point other) → double ,Returns the distance between this and other.
squaredDistanceTo(Point other) → T ,Returns the squared distance between this and other.
toString() → String ,Returns a string representation of this object.override
noSuchMethod(Invocation invocation) → dynamic, Invoked when a non-existent method or property is accessed. inherited
操作符Operators
operator *(num factor) → Point ,Scale this point by factor as if it were a vector.
operator +(Point other) → Point ,Add other to this, as if both points were vectors.
operator -(Point other) → Point, Subtract other from this, as if both points were vectors.
operator ==(dynamic other) → bool ,A Point is only equal to another Point with the same coordinates. override