Vector2

class Vector2 @JvmOverloads constructor(x: Int, y: Int) : Comparable<Vector2?>

Vector2 An object representing a mathematical vector in 2D cartesian coordinate space.

Constructors

Vector2
Link copied to clipboard
fun Vector2(p: Point)
Vector2
Link copied to clipboard
fun Vector2(x: Int = 0, y: Int = 0)

Functions

add
Link copied to clipboard
fun add(u: Vector2): Vector2
angleTo
Link copied to clipboard
fun angleTo(v: Vector2): Double
compareTo
Link copied to clipboard
open operator override fun compareTo(o: Vector2?): Int
cross
Link copied to clipboard
fun cross(U: Vector2, a: Double): Double
distanceTo
Link copied to clipboard
fun distanceTo(v: Vector2): Double
dot
Link copied to clipboard
fun dot(U: Vector2): Double
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
gradientTo
Link copied to clipboard
fun gradientTo(v: Vector2): Double
hashCode
Link copied to clipboard
open override fun hashCode(): Int
magnitude
Link copied to clipboard
fun magnitude(): Double
mul
Link copied to clipboard
fun mul(u: Double): Vector2
toLong2D
Link copied to clipboard
fun toLong2D(): Long
toMatrix
Link copied to clipboard
fun toMatrix(): IntArray
toPoint
Link copied to clipboard
fun toPoint(): Point
toString
Link copied to clipboard
open override fun toString(): String

Properties

x
Link copied to clipboard
val x: Int = 0
y
Link copied to clipboard
val y: Int = 0