IVec2Ops

Description

[StaticTemplate]
interface Tinman.Core.Math.Vectors.IVec2Ops
<TVector val : IVec2Ops<TVector, TCoord>>
<TCoord val>

Derived from

IVecOps<TVector, TCoord>

Extended by

Vec2D struct
Vec2F struct
Vec2I struct
Vec2L struct

Defines common operations for 2D vector types.

Public / Methods

Add


[Pure]
public method Add → (2)

in : TCoord

X-component of vector.

in : TCoord

Y-component of vector.

returns → TVector

The resulting vector.

Adds this vector and the given one (component-wise).

Cross

3 overloads


[Pure]
public method Cross1 → (1)

in : TCoord

Z-component of vector (X- and Y-components are zero).

returns → TVector

The cross product vector.

Computes the cross product between this vector and the given one: this x other.


[Pure]
public method Cross2 → (1)

in : TVector

The other vector.

returns → TCoord

The Z-component of the cross product vector (X- and Y-components are zero).

Computes the cross product between this vector and the given one: this x other.


[Pure]
public method Cross3 → (2)

in : TCoord

X-component of vector.

in : TCoord

Y-component of vector.

returns → TCoord

The Z-component of the cross product vector (X- and Y-components are zero).

Computes the cross product between this vector and the given one: this x other.

Dot


[Pure]
public method Dot → (2)

in : TCoord

X-component of vector.

in : TCoord

Y-component of vector.

returns → TCoord

The resulting vector.

Computes the dot product between this vector and the given one.

Equals


[Pure]
public method Equals → (2)

in : TCoord

X-component of vector.

in : TCoord

Y-component of vector.

returns → bool

true if both vectors are equal, false if they are not.

Checks if this vector and the given one are equal.

Equals​Almost


[Pure]
public method EqualsAlmost → (2)

in : TCoord

X-component of vector.

in : TCoord

Y-component of vector.

returns → bool

true if both vectors are similar, false if they are not.

Checks if this vector and the given one are similar but necessarily equal.

Vectors with an integral component type will delegate to Equals.

See also

Maths.Similar2

Max


[Pure]
public method Max → (2)

in : TCoord

X-component of vector.

in : TCoord

Y-component of vector.

returns → TVector

The resulting vector.

Computes the maximum of this vector and the given one (component-wise).

Min


[Pure]
public method Min → (2)

in : TCoord

X-component of vector.

in : TCoord

Y-component of vector.

returns → TVector

The resulting vector.

Computes the minimum of this vector and the given one (component-wise).

Mul


[Pure]
public method Mul → (2)

in : TCoord

X-component of vector.

in : TCoord

Y-component of vector.

returns → TVector

The resulting vector.

Multiplies this vector with the given one (component-wise).

Sub


[Pure]
public method Sub → (2)

in : TCoord

X-component of vector.

in : TCoord

Y-component of vector.

returns → TVector

The resulting vector.

Subtracts the given vector from this one (component-wise).