Salta ai contenuti
Seleziona lingua:Italiano
Questa pagina è disponibile solo in inglese.

MCL 1.3.5

class Vec3d(x: Double, y: Double, z: Double) : Vecd

Represents a 3D vector of Floating-point double precision coordinates.

Parameters

x

X component.

y

Y component.

z

Z component.

Constructors

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

Types

Properties

Returns the magnitude (norm) of the vector.

Returns the squared magnitude of the vector.

Returns a normalized copy of the vector.

val size: Int

Returns the size of the vector.

val x: Double

X component.

val y: Double

Y component.

val z: Double

Z component.

Functions

infix fun cross(o: Vec3d): Vec3d

Computes the cross product of two vectors.

infix fun dot(o: Vec3d): Double

Computes the dot product of two vectors.

operator fun get(i: Int): Double

Returns the value at the specified index.

operator fun minus(o: Vec3d): Vec3d

Subtracts one vector from another.

operator fun plus(o: Vec3d): Vec3d

Adds two vectors.

operator fun times(s: Double): Vec3d

Multiplies a vector by a scalar.

fun toFloat(): Vec3f

Converts this vector to a Vec3f object.

open override fun toString(): String

Returns a JSON-like string representation of the vector with components formatted to three decimal digits.

fun toVec2d(): Vec2d

Converts this vector to a Vec2d object.

Converts this vector to a Vec4d object.