Circle

data class Circle(val center: Vector2, val radius: Double) : Movable, Scalable1D, ShapeProvider, ShapeContourProvider

Creates a Circle.

Alternatively, see Ellipse.

Constructors

Link copied to clipboard
fun Circle(    x: Double,     y: Double,     radius: Double)
Link copied to clipboard
fun Circle(center: Vector2, radius: Double)

Types

Link copied to clipboard
object Companion

Functions

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

Returns true if given point lies inside the Shape.

Link copied to clipboard
operator fun div(scale: Double): Circle
Link copied to clipboard
operator 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
operator fun plus(right: Circle): Circle
Link copied to clipboard
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.

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.

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
fun tangents(point: Vector2): Pair<Vector2, Vector2>

Calculates the tangent lines through an external point.

fun tangents(other: Circle, isInner: Boolean = false): List<Pair<Vector2, Vector2>>

Calculates the tangent lines between two Circles.

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

Properties

Link copied to clipboard
val area: Double
Link copied to clipboard
val center: Vector2
Link copied to clipboard
open override val contour: ShapeContour

Returns ShapeContour representation of the Circle.

Link copied to clipboard
val corner: Vector2

The top-left corner of the Circle.

Link copied to clipboard
val radius: 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.

Sources

Link copied to clipboard