Vector3

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

Double-precision 3D vector.

Constructors

Link copied to clipboard
constructor(x: Double)
constructor(x: Double, y: Double, z: Double)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open fun areaBetween(other: Vector3): Double

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

Link copied to clipboard
open fun atan2(other: Vector3): Double

atan2 style angle between this and other

Link copied to clipboard

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

Link copied to clipboard
infix fun cross(v: Vector3): Vector3

Calculates a cross product between this Vector2 and v.

Link copied to clipboard
open override fun distanceTo(other: Vector3): Double

distance to other in Euclidean space

Link copied to clipboard
open operator override fun div(scale: Double): Vector3
operator fun div(v: Vector3): Vector3
Link copied to clipboard
open infix override fun dot(right: Vector3): Double

Calculates a dot product between this Vector2 and right.

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

apply function to all components

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

project this vector on on

Link copied to clipboard
open infix fun reflectedOver(surfaceNormal: Vector3): Vector3

reflect this vector over surfaceNormal

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun squaredDistanceTo(other: Vector3): Double

squared distance to other in Euclidean space

Link copied to clipboard
open operator override fun times(scale: Double): Vector3
operator fun times(v: Vector3): Vector3
Link copied to clipboard
Link copied to clipboard

Casts to IntVector3.

Link copied to clipboard
operator fun unaryMinus(): Vector3

Properties

Link copied to clipboard
open override val length: Double

The Euclidean length of the vector.

Link copied to clipboard

normalized vector

Link copied to clipboard
Link copied to clipboard
open override val squaredLength: Double

The squared Euclidean length of the vector.

Link copied to clipboard
val x: Double
Link copied to clipboard
val xy: Vector2
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val xz: Vector2
Link copied to clipboard
val y: Double
Link copied to clipboard
val yx: Vector2
Link copied to clipboard
val z: Double
Link copied to clipboard
open override val zero: Vector3

returns the zero vector

Link copied to clipboard
val zx: Vector2