Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace point

Index

Functions

add

  • 将两个点相加,并将结果作为新的点对象返回.

    Parameters

    • a: IPoint

      First point.

    • b: IPoint

      Second point.

    • Optional subtract: boolean

      可选的布尔值减去而不是加法.

    Returns IPoint

    A new point object.

average

  • 获取两点中间值.

    Parameters

    Returns IPoint

    New point object which is the average of a and b.

clone

  • 克隆点.

    Parameters

    • pointToClone: IPoint

      The point to clone.

    Returns IPoint

    A new point with same values as the original.

closest

  • 从点数组中,找到与给定参考点最近的点.

    Parameters

    • referencePoint: IPoint

      The reference point.

    • pointOptions: IPoint[]

      Array of points to choose from.

    Returns IPoint

    The first closest point from the pointOptions.

distort

  • distort(pointToDistort: IPoint, scaleX: number, scaleY: number): IPoint
  • 扭曲点.

    Parameters

    • pointToDistort: IPoint

      The point to distort.

    • scaleX: number

      The amount of x scaling.

    • scaleY: number

      The amount of y scaling.

    Returns IPoint

    A new point.

fromAngleOnCircle

  • 以给定的角度获取圆或弧路径上的点.

    Parameters

    • angleInDegrees: number

      要查找点的角度(以度为单位).

    • circle: IPathCircle

      A circle or arc.

    Returns IPoint

    A new point object.

fromArc

  • 获取弧形路径的两个端点.

    Parameters

    Returns IPoint[]

    包含 2 个元素的数组:[0] 是对应于起始角度的点对象,[1] 是对应于结束角度的点对象.

fromPathEnds

  • 获取路径的两个端点.

    Parameters

    • pathContext: IPath

      The path object.

    • Optional pathOffset: IPoint

    Returns IPoint[]

    包含 2 个元素的数组:[0] 是对应于原点的点对象,[1] 是对应于终点的点对象.

fromPolar

  • fromPolar(angleInRadians: number, radius: number): IPoint
  • 从极坐标获取一个点.

    Parameters

    • angleInRadians: number

      极坐标的角度,以弧度为单位.

    • radius: number

      The radius of the polar coordinate.

    Returns IPoint

    A new point object.

fromSlopeIntersection

  • 计算两条线的斜率相交.

    Parameters

    Returns IPoint

    两个斜坡的交点,如果坡度不相交,则为空.

middle

  • 获取路径的中点.

    Parameters

    • pathContext: IPath

      The path object.

    • Default value ratio: number = 0.5

      路径上点的可选比率(介于 0 和 1 之间)。中间默认值为 .5.

    Returns IPoint

    路径上的点,在路径的中间.

mirror

  • mirror(pointToMirror: IPoint, mirrorX: boolean, mirrorY: boolean): IPoint
  • 创建点的克隆,在 x 轴和 y 轴上或两个轴上镜像.

    Parameters

    • pointToMirror: IPoint

      The point to mirror.

    • mirrorX: boolean

      Boolean to mirror on the x axis.

    • mirrorY: boolean

      Boolean to mirror on the y axis.

    Returns IPoint

    Mirrored point.

rotate

  • 旋转点.

    Parameters

    • pointToRotate: IPoint

      The point to rotate.

    • angleInDegrees: number

      The amount of rotation, in degrees.

    • Default value rotationOrigin: IPoint = [0, 0]

      The center point of rotation.

    Returns IPoint

    A new point.

rounded

  • 四舍五入点的值.

    Parameters

    • pointContext: IPoint

      The point to serialize.

    • Optional accuracy: number

      Optional exemplar number of decimal places.

    Returns IPoint

    A new point with the values rounded.

scale

  • 缩放点的坐标.

    Parameters

    • pointToScale: IPoint

      The point to scale.

    • scaleValue: number

      The amount of scaling.

    • Optional basePoint: IPoint

      The basePoint of scaling.

    Returns IPoint

    A new point.

subtract

  • 从另一个点减去一个点,并将结果作为新点返回. Add(a, b, subtract = true).

    Parameters

    Returns IPoint

    A new point object.

zero

  • 位于 0,0 坐标处的点.

    Returns IPoint

    A new point.

Generated using TypeDoc