# Vector3

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

Double-precision 3D vector.

## Constructors

constructor(x: Double)
constructor(x: Double, y: Double, z: Double)

object Companion

## Functions

open fun areaBetween(other: Vector3): Double

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

open fun atan2(other: Vector3): Double

atan2 style angle between this and other

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

infix fun cross(v: Vector3): Vector3

Calculates a cross product between this Vector2 and v.

open override fun distanceTo(other: Vector3): Double

distance to other in Euclidean space

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

Calculates a dot product between this Vector2 and right.

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

apply function to all components

fun Vector3.map(beforeLeft: Vector3, beforeRight: Vector3, afterLeft: Vector3, afterRight: Vector3, clamp: Boolean = false): Vector3
operator fun minus(d: Double): Vector3
open operator override fun minus(right: Vector3): Vector3
fun mix(o: Vector3, mix: Double): Vector3
operator fun plus(d: Double): Vector3
open operator override fun plus(right: Vector3): Vector3
open infix fun projectedOn(on: Vector3): Vector3

project this vector on on

open infix fun reflectedOver(surfaceNormal: Vector3): Vector3

reflect this vector over surfaceNormal

open override fun squaredDistanceTo(other: Vector3): Double

squared distance to other in Euclidean space

open operator override fun times(scale: Double): Vector3
operator fun times(v: Vector3): Vector3

Casts to IntVector3.

operator fun unaryMinus(): Vector3

## Properties

open override val length: Double

The Euclidean length of the vector.

normalized vector

open override val squaredLength: Double

The squared Euclidean length of the vector.

val x: Double
val xy: Vector2
val xz: Vector2