Circle

Represents a circle defined by its center and radius.

This class provides methods to manipulate and query the circle's properties, including scaling, moving, and generating its shape representation. It also offers utility functions to create circles based on specific points.

Constructors

Link copied to clipboard
constructor(center: Vector2, radius: Double)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

The central point of the circle represented as a Vector2.

Link copied to clipboard
open override val contour: ShapeContour

Returns ShapeContour representation of the Circle.

Link copied to clipboard

The top-left corner of the Circle.

Link copied to clipboard

The radius of the circle as a Double.

Link copied to clipboard
open override val scale: Vector2

Current scale of this shape. Generally equivalent to its dimensions.

Link copied to clipboard
open override val shape: Shape

Returns Shape representation of the Circle.

Functions

Link copied to clipboard
operator fun contains(point: Vector2): Boolean

Checks if the given point is located inside the circle.

Link copied to clipboard
open operator override fun div(scale: Double): Circle
Link copied to clipboard
open operator override fun minus(right: Circle): Circle
Link copied to clipboard
open override fun movedBy(offset: Vector2): Circle

Creates a new shape with the same size but the current position offset by the given amount.

Link copied to clipboard
open override fun movedTo(center: Vector2): Circle

Creates a new Circle with center at center.

Link copied to clipboard
open operator override fun plus(right: Circle): Circle
Link copied to clipboard
open override fun position(u: Double, v: Double): Vector2

Returns a position in the bounding box for parameterized values u and v between 0.0 and 1.0 where (0.5, 0.5) is the center of the bounding box.

open fun position(uv: Vector2): Vector2

Returns a position in the bounding box for a parameterized uv value between (0.0, 0.0) and (1.0, 1.0) where (0.5, 0.5) is the center of the bounding box.

Link copied to clipboard
open override fun scaledBy(scale: Double, uAnchor: Double, vAnchor: Double): Circle

Creates a new shape with dimensions scaled by scale.

Link copied to clipboard
open override fun scaledTo(radius: Double): Circle

Creates a new Circle at the same position with the given radius.

Link copied to clipboard
open operator override fun times(scale: Double): Circle