Companion

object Companion

Properties

Link copied to clipboard

Mathematically typical DOWN (0, -1)

Link copied to clipboard

DOWN using screen coordinates as reference (0, +1)

Link copied to clipboard

Mathematically typical LEFT, matching screen coordinates (-1, 0)

Link copied to clipboard
Link copied to clipboard

Mathematically typical RIGHT, matching screen coordinates (+1, 0)

Link copied to clipboard

Mathematically typical UP (0, +1)

Link copied to clipboard

UP using screen coordinates as reference (0, -1)

Link copied to clipboard

Functions

Link copied to clipboard
fun angle(a: Vector2D, b: Vector2D, up: Vector2D = UP): Angle
fun angle(p1: Vector2D, p2: Vector2D, p3: Vector2D, up: Vector2D = UP): Angle
fun angle(ax: Double, ay: Double, bx: Double, by: Double, up: Vector2D = UP): Angle
fun angle(x1: Double, y1: Double, x2: Double, y2: Double, x3: Double, y3: Double, up: Vector2D = UP): Angle
Link copied to clipboard
fun angleArc(a: Vector2D, b: Vector2D, up: Vector2D = UP): Angle
Link copied to clipboard
fun angleFull(a: Vector2D, b: Vector2D, up: Vector2D = UP): Angle
Link copied to clipboard
fun compare(lx: Double, ly: Double, rx: Double, ry: Double): Int
fun compare(lx: Float, ly: Float, rx: Float, ry: Float): Int
Link copied to clipboard
fun crossProduct(ax: Double, ay: Double, bx: Double, by: Double): Double
fun crossProduct(ax: Float, ay: Float, bx: Float, by: Float): Float
Link copied to clipboard
inline fun direction(a: Vector2D, b: Vector2D): Vector2D
Link copied to clipboard
fun distance(x1: Double, y1: Double, x2: Double, y2: Double): Double
fun distance(x1: Float, y1: Float, x2: Float, y2: Float): Double
fun distance(x1: Int, y1: Int, x2: Int, y2: Int): Double
Link copied to clipboard
Link copied to clipboard
fun dot(aX: Double, aY: Double, bX: Double, bY: Double): Double
fun dot(aX: Float, aY: Float, bX: Float, bY: Float): Float
Link copied to clipboard
inline operator fun invoke(x: Number, y: Number): Vector2D
Link copied to clipboard
fun isCollinear(p1: Point, p2: Point, p3: Point): Boolean
fun isCollinear(p1x: Double, p1y: Double, p2x: Double, p2y: Double, p3x: Double, p3y: Double): Boolean
fun isCollinear(xa: Float, ya: Float, x: Float, y: Float, xb: Float, yb: Float): Boolean
fun isCollinear(xa: Int, ya: Int, x: Int, y: Int, xb: Int, yb: Int): Boolean
Link copied to clipboard
Link copied to clipboard
inline fun middle(a: Vector2D, b: Vector2D): Vector2D
Link copied to clipboard
Link copied to clipboard
fun orientation(p1: Vector2D, p2: Vector2D, p3: Vector2D, up: Vector2D = UP): Double

< 0 left, 0 right, 0 collinear

fun orientation(ax: Double, ay: Double, bx: Double, by: Double, cx: Double, cy: Double, up: Vector2D = UP): Double
fun orientation(ax: Float, ay: Float, bx: Float, by: Float, cx: Float, cy: Float, up: Vector2D = UP): Float
Link copied to clipboard
inline fun polar(angle: Angle, length: Double = 1.0, up: Vector2D = UP): Vector2D
inline fun polar(base: Vector2D, angle: Angle, length: Double = 1.0, up: Vector2D = UP): Vector2D
inline fun polar(x: Double, y: Double, angle: Angle, length: Double = 1.0, up: Vector2D = UP): Vector2D

inline fun polar(x: Float, y: Float, angle: Angle, length: Float = 1.0f, up: Vector2D = UP): Vector2D

Constructs a point from polar coordinates determined by an angle and a length. Angle 0 is pointing to the right, and the direction is counter-clock-wise for up=UP and clock-wise for up=UP_SCREEN