Vector2D

data class Vector2D(val x: Double, val y: Double) : IsAlmostEquals<Vector2D>

Constructors

Link copied to clipboard
constructor(x: Float, y: Float)
constructor(x: Int, y: Int)
constructor(x: Double, y: Int)
constructor(x: Int, y: Double)
constructor(x: Float, y: Int)
constructor(x: Int, y: Float)
constructor()
constructor(x: Double, y: Double)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val x: Double
Link copied to clipboard
val y: Double

Functions

Link copied to clipboard
fun angle(up: Vector2D = UP): Angle
Link copied to clipboard
fun angleTo(other: Vector2D, up: Vector2D = UP): Angle
Link copied to clipboard
Link copied to clipboard
fun ceil(): Vector2D
Link copied to clipboard
Link copied to clipboard
fun copy(x: Float = this.x.toFloat(), y: Float = this.y.toFloat()): Vector2D
Link copied to clipboard
infix fun cross(that: Vector2D): Double
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline operator fun div(that: Size): Vector2D
inline operator fun div(that: Vector2D): Vector2D
inline operator fun div(scale: Double): Vector2D
inline operator fun div(scale: Float): Vector2D
inline operator fun div(scale: Int): Vector2D
Link copied to clipboard
operator fun Vector2D.div(other: Scale): Vector2D
operator fun Vector2D.div(other: Size): Vector2D
operator fun Vector2D.div(other: SizeInt): Vector2D
Link copied to clipboard
infix fun dot(that: Vector2D): Double
Link copied to clipboard
Link copied to clipboard
operator fun get(component: Int): Double
Link copied to clipboard
fun interpolateWith(ratio: Ratio, other: Vector2D): Vector2D
Link copied to clipboard
fun inv(): Vector2D

Vector2 with inverted (1f / v) components to this

Link copied to clipboard
open override fun isAlmostEquals(other: Vector2D, epsilon: Double): Boolean
Link copied to clipboard
fun isNaN(): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline operator fun minus(that: Size): Vector2D
inline operator fun minus(that: Vector2D): Vector2D
Link copied to clipboard
operator fun Vector2D.minus(other: Size): Vector2D
operator fun Vector2D.minus(other: SizeInt): Vector2D
Link copied to clipboard
fun Point.mutable(out: MPoint = MPoint()): MPoint
Link copied to clipboard
fun niceStr(decimalPlaces: Int): String
Link copied to clipboard
inline operator fun plus(that: Size): Vector2D
inline operator fun plus(that: Vector2D): Vector2D
Link copied to clipboard
operator fun Vector2D.plus(other: Size): Vector2D
operator fun Vector2D.plus(other: SizeInt): Vector2D
Link copied to clipboard
Link copied to clipboard
inline operator fun rem(that: Size): Vector2D
inline operator fun rem(that: Vector2D): Vector2D
inline operator fun rem(scale: Double): Vector2D
inline operator fun rem(scale: Float): Vector2D
inline operator fun rem(scale: Int): Vector2D
Link copied to clipboard
operator fun Vector2D.rem(other: Scale): Vector2D
operator fun Vector2D.rem(other: Size): Vector2D
operator fun Vector2D.rem(other: SizeInt): Vector2D
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline operator fun times(that: Scale): Vector2D
inline operator fun times(that: Size): Vector2D
inline operator fun times(that: Vector2D): Vector2D
inline operator fun times(scale: Double): Vector2D
inline operator fun times(scale: Float): Vector2D
inline operator fun times(scale: Int): Vector2D
Link copied to clipboard
operator fun Vector2D.times(other: Scale): Vector2D
operator fun Vector2D.times(other: Size): Vector2D
operator fun Vector2D.times(other: SizeInt): Vector2D
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun Point.toMPoint(out: MPoint = MPoint()): MPoint
Link copied to clipboard

Normal vector. Rotates the vector/point -90 degrees (not normalizing it)

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
inline fun transformed(m: Matrix): Vector2D
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline operator fun unaryMinus(): Vector2D
Link copied to clipboard
inline operator fun unaryPlus(): Vector2D