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.Spherical Struct Reference

Description

A spherical vector.

<remark>This is a struct such that it is a value type and cannot be null

Public Member Functions

 Spherical (float distance, Direction direction)
 Create a spherical vector.
 
readonly Vector3 ToVector3 ()
 
readonly Vector3Float ToVector3 ()
 
override readonly string ToString ()
 
override readonly bool Equals (object o)
 
override readonly int GetHashCode ()
 

Static Public Member Functions

static Spherical Degrees (float distance, float horizontal, float vertical)
 Create spherical vector. All given angles are in degrees.
 
static Spherical Radians (float distance, float horizontal, float vertical)
 
static Spherical FromVector3 (Vector3 v)
 
static Spherical FromVector3 (Vector3Float v)
 
static Spherical operator+ (Spherical s1, Spherical s2)
 
static Spherical operator* (Spherical v, float d)
 
static bool operator== (Spherical v1, Spherical v2)
 
static bool operator!= (Spherical v1, Spherical v2)
 
static float Distance (Spherical v1, Spherical v2)
 
static Spherical Average (Spherical v1, Spherical v2)
 
static Spherical Sum (List< Spherical > vectors)
 
static Spherical Average (List< Spherical > vectors)
 

Public Attributes

float distance
 The distance in meters.
 
Direction direction
 The direction of the vector.
 

Static Public Attributes

static readonly Spherical zero = new(0, Direction.forward)
 A spherical vector with zero degree angles and distance.
 
static readonly Spherical forward = new(1, Direction.forward)
 A normalized forward-oriented vector.
 

Properties

readonly float magnitude [get]
 
Spherical normalized [get]
 

Constructor & Destructor Documentation

◆ Spherical()

LinearAlgebra.Spherical.Spherical ( float  distance,
Direction  direction 
)

Create a spherical vector.

Parameters
distanceThe distance in meters
directionThe direction of the vector

Member Function Documentation

◆ Degrees()

static Spherical LinearAlgebra.Spherical.Degrees ( float  distance,
float  horizontal,
float  vertical 
)
static

Create spherical vector. All given angles are in degrees.

Parameters
distanceThe distance in meters
horizontalThe horizontal angle in degrees
verticalThe vertical angle in degrees
Returns

Member Data Documentation

◆ distance

float LinearAlgebra.Spherical.distance

The distance in meters.

Remarks
The distance should never be negative

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