Line2D

data class Line2D(val a: Vector2D, val b: Vector2D) : Shape2D

Constructors

Link copied to clipboard
constructor()
constructor(x0: Double, y0: Double, x1: Double, y1: Double)
constructor(x0: Float, y0: Float, x1: Float, y1: Float)
constructor(x0: Int, y0: Int, x1: Int, y1: Int)
constructor(a: Vector2D, b: Vector2D)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val a: Vector2D
Link copied to clipboard
Link copied to clipboard
open override val area: Double
Link copied to clipboard
val b: Vector2D
Link copied to clipboard
open override val center: Point
Link copied to clipboard
open val closed: Boolean
Link copied to clipboard
val dx: Double
Link copied to clipboard
val dy: Double
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val max: Point
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val min: Point
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val perimeter: Double
Link copied to clipboard
val x0: Double
Link copied to clipboard
val x1: Double
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val y0: Double
Link copied to clipboard
val y1: Double
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
open override fun containsPoint(p: Point): Boolean

open fun containsPoint(ml: Matrix, p: Point, mr: Matrix): Boolean

ml transformation matrix of this Shape2D, mr transformation matrix of the point p

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun distance(p: Point): Double

Compute the distance to the shortest point to the edge (SDF). Negative inside. Positive outside.

open fun distance(ml: Matrix, p: Point, mr: Matrix): Double

ml transformation matrix of this Shape2D, mr transformation matrix of the point p

Link copied to clipboard
inline fun flipped(): Line
Link copied to clipboard
open fun getBounds(): Rectangle
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

open fun intersectionsWith(ml: Matrix, that: Shape2D, mr: Matrix): PointList

ml transformation matrix of this Shape2D, mr transformation matrix of the shape that

Link copied to clipboard
fun intersects(line: Line): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun intersectsWith(that: Shape2D): Boolean
open fun intersectsWith(ml: Matrix, that: Shape2D, mr: Matrix): Boolean
Link copied to clipboard
fun isNaN(): Boolean
Link copied to clipboard
open override fun normalVectorAt(p: Point): Vector2D

Returns the normal vector to the shortest point to the edge

open fun normalVectorAt(ml: Matrix, p: Point, mr: Matrix): Point

ml transformation matrix of this Shape2D, mr transformation matrix of the point p

Link copied to clipboard
open override fun projectedPoint(p: Point): Point

Point projected to the closest edge

open fun projectedPoint(ml: Matrix, p: Point, mr: Matrix): Point

ml transformation matrix of this Shape2D, mr transformation matrix of the point p

Link copied to clipboard
fun round(): Line
Link copied to clipboard
fun scaledPoints(scale: Double): Line
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun toRay(): Ray
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open override fun toVectorPath(): VectorPath