# Vector4

@Serializable
data class Vector4(    val x: Double,     val y: Double,     val z: Double,     val w: Double) : LinearType<Vector4> , EuclideanVector<Vector4>

Double-precision 4D vector.

## Constructors

fun Vector4(x: Double)
fun Vector4(    x: Double,     y: Double,     z: Double,     w: Double)

object Companion

## Functions

open fun areaBetween(other: Vector4): Double

returns the area of the parallelogram formed by extruding this over other

open fun atan2(other: Vector4): Double

atan2 style angle between this and other

open override fun distanceTo(other: Vector4): Double

Calculates the Euclidean distance to other.

open operator override fun div(scale: Double): Vector4
operator fun div(v: Vector4): Vector4
open infix override fun dot(right: Vector4): Double

Calculates a dot product between this Vector4 and right.

operator fun get(i: Int): Double
open override fun map(function: (Double) -> Double): Vector4

apply function to all components

operator fun minus(d: Double): Vector4
open operator override fun minus(right: Vector4): Vector4
fun mix(o: Vector4, mix: Double): Vector4
operator fun plus(d: Double): Vector4
open operator override fun plus(right: Vector4): Vector4
open infix fun projectedOn(on: Vector4): Vector4

project this vector on on

open infix fun reflectedOver(surfaceNormal: Vector4): Vector4

reflect this vector over surfaceNormal

open override fun squaredDistanceTo(other: Vector4): Double

Calculates the squared Euclidean distance to other.

open operator override fun times(scale: Double): Vector4
operator fun times(v: Vector4): Vector4
fun toDoubleArray(): DoubleArray

Casts to DoubleArray.

fun toInt(): IntVector4

Casts to IntVector4.

operator fun unaryMinus(): Vector4

## Properties

val div: Vector3

Calculates Vector3 by dividing x, y, z by w.

open override val length: Double

The Euclidean length of the vector.

open val normalized: Vector4

normalized vector

open override val squaredLength: Double

The squared Euclidean length of the vector.

val w: Double
val x: Double
val xy: Vector2
val xyz: Vector3

Downcasts to Vector3 by discarding w.

val xz: Vector2
val y: Double
val yx: Vector2
val yz: Vector2
val z: Double
open override val zero: Vector4

returns the zero vector

val zx: Vector2
val zy: Vector2

## Extensions

fun Vector4.clamp(min: Vector4, max: Vector4): Vector4

Returns Vector4 whose value is limited between min and max per vector component.