Nano Brain for Unity v0.1
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
LinearAlgebra.Vector3Int Struct Reference

Description

3-dimensional vectors

This uses the right-handed coordinate system.

Create a new 3-dimensional vector

Parameters
horizontalx axis value
verticaly axis value
depthz axis value

Public Member Functions

 Vector3Int (int horizontal, int vertical, int depth)
 
bool Equals (Vector3Int v)
 
override bool Equals (object obj)
 
override int GetHashCode ()
 

Static Public Member Functions

static float MagnitudeOf (Vector3Int v)
 The vector length.
 
static float SqrMagnitudeOf (Vector3Int v)
 The squared vector length.
 
static Vector3Float Normalize (Vector3Int v)
 Convert the vector to a length of 1.
 
static Vector3Int operator- (Vector3Int v1)
 Negate te vector such that it points in the opposite direction.
 
static Vector3Int operator- (Vector3Int v1, Vector3Int v2)
 Subtract two vectors.
 
static Vector3Int operator+ (Vector3Int v1, Vector3Int v2)
 Add two vectors.
 
static Vector3Int Scale (Vector3Int v1, Vector3Int v2)
 Scale the vector using another vector.
 
static Vector3Int operator* (Vector3Int v1, int d)
 
static Vector3Int operator* (int d, Vector3Int v1)
 
static Vector3Int operator/ (Vector3Int v1, int d)
 
static bool operator== (Vector3Int v1, Vector3Int v2)
 
static bool operator!= (Vector3Int v1, Vector3Int v2)
 
static float Distance (Vector3Int v1, Vector3Int v2)
 The distance between two vectors.
 
static float Dot (Vector3Int v1, Vector3Int v2)
 The dot product of two vectors.
 
static Vector3Int Cross (Vector3Int v1, Vector3Int v2)
 The cross product of two vectors.
 
static AngleFloat UnsignedAngle (Vector3Int v1, Vector3Int v2)
 The angle between two vectors.
 
static AngleFloat SignedAngle (Vector3Int v1, Vector3Int v2, Vector3Int axis)
 The signed angle between two vectors.
 

Public Attributes

int horizontal
 The right axis of the vector.
 
int vertical
 The upward axis of the vector.
 
int depth
 The forward axis of the vector.
 

Static Public Attributes

static readonly Vector3Int zero = new(0, 0, 0)
 A vector with zero for all axis.
 
static readonly Vector3Int one = new(1, 1, 1)
 A vector with one for all axis.
 
static readonly Vector3Int left = new(-1, 0, 0)
 A Vector3Int with values (-1, 0, 0)
 
static readonly Vector3Int right = new(1, 0, 0)
 A vector with values (1, 0, 0)
 
static readonly Vector3Int down = new(0, -1, 0)
 A vector with values (0, -1, 0)
 
static readonly Vector3Int up = new(0, 1, 0)
 A vector with values (0, 1, 0)
 
static readonly Vector3Int back = new(0, -1, 0)
 A vector with values (0, 0, -1)
 
static readonly Vector3Int forward = new(0, 1, 0)
 A vector with values (0, 0, 1)
 

Properties

readonly float magnitude [get]
 The vector length.
 
readonly float sqrMagnitude [get]
 The squared vector length.
 
readonly Vector3Float normalized [get]
 Convert the vector to a length of 1.
 

Member Function Documentation

◆ MagnitudeOf()

static float LinearAlgebra.Vector3Int.MagnitudeOf ( Vector3Int  v)
static

The vector length.

Parameters
vThe vector for which you need the length
Returns
The vector length

◆ SqrMagnitudeOf()

static float LinearAlgebra.Vector3Int.SqrMagnitudeOf ( Vector3Int  v)
static

The squared vector length.

Parameters
vThe vector for which you need the squared length
Returns
The squared vector length

The squared length is computationally simpler than the real length. Think of Pythagoras A^2 + B^2 = C^2. This leaves out the calculation of the squared root of C.

◆ Normalize()

static Vector3Float LinearAlgebra.Vector3Int.Normalize ( Vector3Int  v)
static

Convert the vector to a length of 1.

Parameters
vThe vector to convert
Returns
The vector normalized to a length of 1

◆ operator-() [1/2]

static Vector3Int LinearAlgebra.Vector3Int.operator- ( Vector3Int  v1)
static

Negate te vector such that it points in the opposite direction.

Parameters
v1
Returns
The negated vector

◆ operator-() [2/2]

static Vector3Int LinearAlgebra.Vector3Int.operator- ( Vector3Int  v1,
Vector3Int  v2 
)
static

Subtract two vectors.

Parameters
v1
v2
Returns
The result of the subtraction

◆ operator+()

static Vector3Int LinearAlgebra.Vector3Int.operator+ ( Vector3Int  v1,
Vector3Int  v2 
)
static

Add two vectors.

Parameters
v1
v2
Returns
The result of the addition

◆ Scale()

static Vector3Int LinearAlgebra.Vector3Int.Scale ( Vector3Int  v1,
Vector3Int  v2 
)
static

Scale the vector using another vector.

Parameters
v1The vector to scale
v2A vector with the scaling factors
Returns
The scaled vector
Remarks
Each component of the vector v1 will be multiplied with the matching component from the scaling vector v2.

◆ Distance()

static float LinearAlgebra.Vector3Int.Distance ( Vector3Int  v1,
Vector3Int  v2 
)
static

The distance between two vectors.

Parameters
v1The first vector
v2The second vector
Returns
The distance between the two vectors

◆ Dot()

static float LinearAlgebra.Vector3Int.Dot ( Vector3Int  v1,
Vector3Int  v2 
)
static

The dot product of two vectors.

Parameters
v1The first vector
v2The second vector
Returns
The dot product of the two vectors

◆ Cross()

static Vector3Int LinearAlgebra.Vector3Int.Cross ( Vector3Int  v1,
Vector3Int  v2 
)
static

The cross product of two vectors.

Parameters
v1The first vector
v2The second vector
Returns
The cross product of the two vectors

◆ UnsignedAngle()

static AngleFloat LinearAlgebra.Vector3Int.UnsignedAngle ( Vector3Int  v1,
Vector3Int  v2 
)
static

The angle between two vectors.

Parameters
v1The first vector
v2The second vector
Returns
The angle between the two vectors
Remarks
This reterns an unsigned angle which is the shortest distance between the two vectors. Use Vector3::SignedAngle if a signed angle is needed.

◆ SignedAngle()

static AngleFloat LinearAlgebra.Vector3Int.SignedAngle ( Vector3Int  v1,
Vector3Int  v2,
Vector3Int  axis 
)
static

The signed angle between two vectors.

Parameters
v1The starting vector
v2The ending vector
axisThe axis to rotate around
Returns
The signed angle between the two vectors

Property Documentation

◆ magnitude

readonly float LinearAlgebra.Vector3Int.magnitude
get

The vector length.

Returns
The vector length

◆ sqrMagnitude

readonly float LinearAlgebra.Vector3Int.sqrMagnitude
get

The squared vector length.

Returns
The squared vector length
Remarks
The squared length is computationally simpler than the real length. Think of Pythagoras A^2 + B^2 = C^2. This leaves out the calculation of the squared root of C.

◆ normalized

readonly Vector3Float LinearAlgebra.Vector3Int.normalized
get

Convert the vector to a length of 1.

Returns
The vector normalized to a length of 1

The documentation for this struct was generated from the following file: