跳到主要内容

KCircle2d interface

KCircle2d类代表着二维空间中的一个圆。

The KCircle2d class represents a circle in 2d space.

Signature:

export interface KCircle2d extends KCurve2d 

Links: export interface KCircle2d extends KCurve2d

Extends: KCurve2d

Properties

Property

Modifiers

Type

Description

center

readonly

KPoint2d

获取圆心。

Get center of the circle.

radius

readonly

number

获取圆的半径。

Get radius of the circle.

Methods

Method

Description

getTangent(point)

获取圆上一点的法向量。 注意:传入点需要确保落在圆上。

Get circle's tangent vector of a point on the circle. NOTE: the caller need to make sure the point is on the circle.

transform(matrix)

对当前圆进行变换。 注意:如果变换之后的几何不是一个圆,则会抛出error, 本操作仅支持旋转和平移。

Transform this circle to a new one. NOTE: If the new one is not a circle, it will throw error. Only support for rotate and move translation now.