Circle

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

Creates a Circle.

Alternatively, see Ellipse.

Constructors

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

Types

Companion
Link copied to clipboard
common
object Companion

Functions

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

Returns true if given point lies inside the Shape.

div
Link copied to clipboard
common
operator fun div(scale: Double): Circle
minus
Link copied to clipboard
common
operator fun minus(right: Circle): Circle
moved
Link copied to clipboard
common
fun moved(offset: Vector2): Circle

Creates a new Circle with the current center offset by offset.

movedBy
Link copied to clipboard
common
open override fun movedBy(offset: Vector2): Circle

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

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

Creates a new Circle with center at center.

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

scaled
Link copied to clipboard
common
fun scaled(scale: Double): Circle

Creates a new Circle with the scale specified as a multiplier for the current radius.

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

Creates a new shape with dimensions scaled by scale.

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

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

tangents
Link copied to clipboard
common
fun tangents(point: Vector2): Pair<Vector2, Vector2>

Calculates the tangent lines through an external point.

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

Calculates the tangent lines between two Circles.

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

Properties

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

Returns ShapeContour representation of the Circle.

corner
Link copied to clipboard
common
val corner: Vector2

The top-left corner of the Circle.

radius
Link copied to clipboard
common
val radius: Double
scale
Link copied to clipboard
common
open override val scale: Vector2

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

shape
Link copied to clipboard
common
open override val shape: Shape

Returns Shape representation of the Circle.