minus

operator fun Vector.minus(other: Vector): Vector

Subtracts two Vectors component-wise.

Example:

val v1 = Vector(10.0, 8.0, 6.0)
val v2 = Vector(4.0, 3.0, 2.0)
val result = v1 - v2 // Vector(6.0, 5.0, 4.0)

Return

A new Vector with component-wise difference

Parameters

other

The Vector to subtract


operator fun Vector.minus(other: Double): Vector

Subtracts a scalar value from all components of the Vector.

Example:

val v = Vector(10.0, 8.0, 6.0)
val result = v - 2.0 // Vector(8.0, 6.0, 4.0)

Return

A new Vector with the scalar subtracted from all components

Parameters

other

The scalar value to subtract from each component


operator fun Location.minus(vector: Vector): Location

Subtracts a Vector from this Location's coordinates.

Example:

val loc = Location(world, 10.0, 64.0, -20.0)
val vec = Vector(5.0, 10.0, 3.0)
val result = loc - vec // Location at (5.0, 54.0, -23.0)

Return

A new Location with the Vector subtracted

Parameters

vector

The Vector to subtract


operator fun Location.minus(other: Location): Location

Subtracts another Location's coordinates from this Location.

Example:

val loc1 = Location(world, 10.0, 20.0, 30.0)
val loc2 = Location(world, 5.0, 10.0, 15.0)
val result = loc1 - loc2 // Location at (5.0, 10.0, 15.0)

Return

A new Location with the coordinates subtracted

Parameters

other

The Location whose coordinates to subtract


operator fun Location.minus(other: Double): Location

Subtracts a scalar value from all coordinates of this Location.

Example:

val loc = Location(world, 10.0, 20.0, 30.0)
val result = loc - 5.0 // Location at (5.0, 15.0, 25.0)

Return

A new Location with the scalar subtracted from all coordinates

Parameters

other

The scalar value to subtract from all coordinates