Vector2

class Vector2(var x: Double = 0.0, var y: Double = 0.0)

A class to represent a cartesian vector

Parameters

x

The value on the x-axis

y

The value on the y-axis

Constructors

Link copied to clipboard
constructor(x: Double = 0.0, y: Double = 0.0)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun distance(other: Vector2): Double

Calculates the distance between two vectors

Link copied to clipboard
operator fun div(other: Int): Vector2
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
operator fun plus(other: Vector2): Vector2

Properties

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