Vector2D

data class Vector2D(val x: Double, val y: Double) : AbstractPoint2D

Represents a vector in two-dimensional space.

Parameters

x

x component (abscissa) of the vector

y

y component (ordinate) of the vector

Constructors

Link copied to clipboard
constructor(v: Pair<Double, Double>)
constructor(x: Double, y: Double)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

List of affine transformation matrices to move and rotate the geometric object.

Link copied to clipboard

L_2 norm of the vector

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

Functions

Link copied to clipboard

Returns the angle between the other vector and this vector.

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

Returns the distance between the other vector and this vector.

Link copied to clipboard
operator fun div(m: Double): Vector2D
Link copied to clipboard

Returns the dot product of this with the other.

Link copied to clipboard
fun fuzzyEquals(o: Vector2D, tolerance: Double): Boolean
Link copied to clipboard
fun fuzzyUnequals(o: Vector2D, tolerance: Double): Boolean
Link copied to clipboard
operator fun minus(v: Vector2D): Vector2D
Link copied to clipboard

Returns the normalized vector.

Link copied to clipboard
operator fun plus(v: Vector2D): Vector2D
Link copied to clipboard

Returns the scalar division of this with the divisor.

Link copied to clipboard

Returns the scalar product of this with the factor.

Link copied to clipboard
operator fun times(m: Double): Vector2D
Link copied to clipboard
fun toVector2DCm(): Vector2D
Link copied to clipboard
fun toVector2DJOML(): Vector2d
Link copied to clipboard
fun toVector3D(z: Double = 0.0): Vector3D
Link copied to clipboard
operator fun unaryMinus(): Vector2D
Link copied to clipboard
operator fun unaryPlus(): Vector2D