KInterval interface
KInterval类代表着一维空间中的一个区间。
The KInterval class represents an interval in 1d space
Signature:
export interface KInterval
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
| number | 获取区间的终点。 Get end of the interval. | |
| number | 获取区间的长度。 Get length of the interval. | |
| number | 获取区 间的中点。 Get middle of the interval. | |
| number | 获取区间的起点。 Get start of the interval. |
Methods
Method | Description |
---|---|
克隆当前区间,返回一个新对象。 Return the cloned object. | |
判断当前区间是否包含某个数值。 Check whether the interval contains a value. | |
判断当前区间是否包含另外一个区间。 Check whether the current interval contains the other interval. | |
构建一个新的区间,起点和终点分别是当前区间起点和终点向外扩张给定距离。 Create a new interval whose start and end are expended by the given number. | |
根据插值系数求得区间起点和终点之间的插值结果。 Get the interpolated value by the input coefficient. | |
求当前区间和另外一个区间的相交部分,返回相交部分的区间。如果两个区间不相交,则返回一个不合法区间。 Get the intersected part between current interval and the other interval. If two intervals are not intersected, then return an invalid interval. | |
判断当前区间是否和另外一个区间相交。 Check whther the current interval intersects with the other interval. | |
判断当前区间和另外一个区间是否相等。 Returns true if this interval equals to another within specified tolerance. | |
判断当前区间是否合法。 Check whether the interval is valid. | |
构建一个新区间,起点和终点是当前区间的起点和终点乘上一个数。 Create a new interval whose start and end are multiplied the given number. | |
构建一个新的区间,起点和终点分别是当前区间的起点和终点加上输入数值。 Create a new interval which is offset by the given number. | |
把当前区间转成字符串。 Convert the interval to string format. | |
合并当前区间和另外一个区间,返回叠加在一起后的区间。如果两个区间不相交,则返回一个不合法区间。 Combine the current interval and the other interval, return a new interval. If two intervals are not intersected, then return an invalid interval. |