Companion

object Companion

Properties

Link copied to clipboard

Mathematically typical DOWN (0, -1)

Link copied to clipboard

DOWN using 2D 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 2D screen coordinates as reference (0, -1)

Link copied to clipboard

Functions

Link copied to clipboard
fun angle(a: Vector2F, b: Vector2F, up: Vector2D = Vector2D.UP): Angle
fun angle(p1: Vector2F, p2: Vector2F, p3: Vector2F, up: Vector2D = Vector2D.UP): Angle
fun angle(ax: Double, ay: Double, bx: Double, by: Double, up: Vector2D = Vector2D.UP): Angle
fun angle(x1: Double, y1: Double, x2: Double, y2: Double, x3: Double, y3: Double, up: Vector2D = Vector2D.UP): Angle
Link copied to clipboard
fun angleArc(a: Vector2F, b: Vector2F, up: Vector2D = Vector2D.UP): Angle
Link copied to clipboard
fun angleFull(a: Vector2F, b: Vector2F, up: Vector2D = 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: Vector2F, b: Vector2F): Vector2F
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): Float
fun distance(x1: Int, y1: Int, x2: Int, y2: Int): Float
Link copied to clipboard
Link copied to clipboard
fun dot(a: Vector2F, b: Vector2F): Float
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
fun isCollinear(p1: Point, p2: Point, p3: Point): Boolean
fun isCollinear(xa: Double, ya: Double, x: Double, y: Double, xb: Double, yb: Double): Boolean
fun isCollinear(p1x: Float, p1y: Float, p2x: Float, p2y: Float, p3x: Float, p3y: 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: Vector2F, b: Vector2F): Vector2F
Link copied to clipboard
Link copied to clipboard
fun orientation(p1: Vector2F, p2: Vector2F, p3: Vector2F, up: Vector2D = Vector2D.UP): Float

< 0 left, 0 right, 0 collinear

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

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

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