Dart的math库里Point类的属性和方法等

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值