KSP API
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties
Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
Vector3d Struct Reference

A Vector3d in 3D space. Vector3d is just like Unity's Vector3 class, except it uses doubles instead of floats, so refer to the Unity documentation on Vector3. Vector3d also adds a few functions. More...

Public Member Functions

 Vector3d (double x, double y)
 
 Vector3d (double x, double y, double z)
 
override bool Equals (object other)
 
override int GetHashCode ()
 
void Normalize ()
 
void Scale (Vector3d scale)
 
override string ToString ()
 

Static Public Member Functions

static Vector3d operator- (Vector3d a)
 
static Vector3d operator- (Vector3 a, Vector3d b)
 
static Vector3d operator- (Vector3d a, Vector3 b)
 
static Vector3d operator- (Vector3d a, Vector3d b)
 
static bool operator!= (Vector3d lhs, Vector3d rhs)
 
static Vector3d operator* (double d, Vector3d a)
 
static Vector3d operator* (Vector3d a, double d)
 
static Vector3d operator/ (Vector3d a, double d)
 
static Vector3d operator+ (Vector3 a, Vector3d b)
 
static Vector3d operator+ (Vector3d a, Vector3 b)
 
static Vector3d operator+ (Vector3d a, Vector3d b)
 
static bool operator== (Vector3d lhs, Vector3d rhs)
 
static implicit operator Vector3d (Vector3 v)
 
static implicit operator Vector3 (Vector3d v)
 
static double Angle (Vector3d from, Vector3d to)
 
static double AngleBetween (Vector3d from, Vector3d to)
 
static Vector3d Cross (Vector3d lhs, Vector3d rhs)
 
static double Distance (Vector3d a, Vector3d b)
 
static double Dot (Vector3d lhs, Vector3d rhs)
 
static Vector3d Exclude (Vector3d excludeThis, Vector3d fromThat)
 Returns More...
 
static Vector3d Lerp (Vector3d from, Vector3d to, float t)
 
static double Magnitude (Vector3d a)
 
static Vector3d Max (Vector3d lhs, Vector3d rhs)
 
static Vector3d Min (Vector3d lhs, Vector3d rhs)
 
static Vector3d Normalize (Vector3d value)
 
static void OrthoNormalize (ref Vector3d normal, ref Vector3d tangent)
 
static void OrthoNormalize (ref Vector3d normal, ref Vector3d tangent, ref Vector3d binormal)
 
static Vector3d Project (Vector3d vector, Vector3d onNormal)
 
static Vector3d Reflect (Vector3d inDirection, Vector3d inNormal)
 
static Vector3d RotateTowards (Vector3d from, Vector3d to, float maxRadiansDelta, float maxMagnitudeDelta)
 
static Vector3d Scale (Vector3d a, Vector3d b)
 
static Vector3d Slerp (Vector3d from, Vector3d to, float t)
 
static double SqrMagnitude (Vector3d a)
 

Public Attributes

const float kEpsilon = 1e-005f
 
double x
 
double y
 
double z
 

Properties

static Vector3d back [get]
 Minus forward More...
 
static Vector3d down [get]
 Minus up More...
 
static Vector3d forward [get]
 
static Vector3d fwd [get]
 
static Vector3d left [get]
 Minus right. More...
 
double magnitude [get]
 
Vector3d normalized [get]
 
static Vector3d one [get]
 
static Vector3d right [get]
 
double sqrMagnitude [get]
 
static Vector3d up [get]
 
Vector3d xzy [get]
 Returs a new Vector3d with the y and z coordinates swapped? More...
 
static Vector3d zero [get]
 
double this[int index] [get, set]
 

Detailed Description

A Vector3d in 3D space. Vector3d is just like Unity's Vector3 class, except it uses doubles instead of floats, so refer to the Unity documentation on Vector3. Vector3d also adds a few functions.

Constructor & Destructor Documentation

Vector3d.Vector3d ( double  x,
double  y 
)
Vector3d.Vector3d ( double  x,
double  y,
double  z 
)

Member Function Documentation

static double Vector3d.Angle ( Vector3d  from,
Vector3d  to 
)
static
static double Vector3d.AngleBetween ( Vector3d  from,
Vector3d  to 
)
static
static Vector3d Vector3d.Cross ( Vector3d  lhs,
Vector3d  rhs 
)
static
static double Vector3d.Distance ( Vector3d  a,
Vector3d  b 
)
static
static double Vector3d.Dot ( Vector3d  lhs,
Vector3d  rhs 
)
static
override bool Vector3d.Equals ( object  other)
static Vector3d Vector3d.Exclude ( Vector3d  excludeThis,
Vector3d  fromThat 
)
static

Returns

fromThat - Vector3d.Project(fromThat, excludeThis). That is, it removes the component of fromThat that is parallel to excludeThis and returns the remainder, which will be perpendicular to excludeThis.

Parameters
excludeThisThe direction to exclude from the result.
fromThatThe starting vector
Returns
A vector perpendicular to excludeThis and pointing in the same general direction as fromThat.
override int Vector3d.GetHashCode ( )
static Vector3d Vector3d.Lerp ( Vector3d  from,
Vector3d  to,
float  t 
)
static
static double Vector3d.Magnitude ( Vector3d  a)
static
static Vector3d Vector3d.Max ( Vector3d  lhs,
Vector3d  rhs 
)
static
static Vector3d Vector3d.Min ( Vector3d  lhs,
Vector3d  rhs 
)
static
void Vector3d.Normalize ( )
static Vector3d Vector3d.Normalize ( Vector3d  value)
static
static implicit Vector3d.operator Vector3 ( Vector3d  v)
static
static implicit Vector3d.operator Vector3d ( Vector3  v)
static
static bool Vector3d.operator!= ( Vector3d  lhs,
Vector3d  rhs 
)
static
static Vector3d Vector3d.operator* ( double  d,
Vector3d  a 
)
static
static Vector3d Vector3d.operator* ( Vector3d  a,
double  d 
)
static
static Vector3d Vector3d.operator+ ( Vector3  a,
Vector3d  b 
)
static
static Vector3d Vector3d.operator+ ( Vector3d  a,
Vector3  b 
)
static
static Vector3d Vector3d.operator+ ( Vector3d  a,
Vector3d  b 
)
static
static Vector3d Vector3d.operator- ( Vector3d  a)
static
static Vector3d Vector3d.operator- ( Vector3  a,
Vector3d  b 
)
static
static Vector3d Vector3d.operator- ( Vector3d  a,
Vector3  b 
)
static
static Vector3d Vector3d.operator- ( Vector3d  a,
Vector3d  b 
)
static
static Vector3d Vector3d.operator/ ( Vector3d  a,
double  d 
)
static
static bool Vector3d.operator== ( Vector3d  lhs,
Vector3d  rhs 
)
static
static void Vector3d.OrthoNormalize ( ref Vector3d  normal,
ref Vector3d  tangent 
)
static
static void Vector3d.OrthoNormalize ( ref Vector3d  normal,
ref Vector3d  tangent,
ref Vector3d  binormal 
)
static
static Vector3d Vector3d.Project ( Vector3d  vector,
Vector3d  onNormal 
)
static
static Vector3d Vector3d.Reflect ( Vector3d  inDirection,
Vector3d  inNormal 
)
static
static Vector3d Vector3d.RotateTowards ( Vector3d  from,
Vector3d  to,
float  maxRadiansDelta,
float  maxMagnitudeDelta 
)
static
void Vector3d.Scale ( Vector3d  scale)
static Vector3d Vector3d.Scale ( Vector3d  a,
Vector3d  b 
)
static
static Vector3d Vector3d.Slerp ( Vector3d  from,
Vector3d  to,
float  t 
)
static
static double Vector3d.SqrMagnitude ( Vector3d  a)
static
override string Vector3d.ToString ( )

Member Data Documentation

const float Vector3d.kEpsilon = 1e-005f
double Vector3d.x
double Vector3d.y
double Vector3d.z

Property Documentation

Vector3d Vector3d.back
staticget

Minus forward

Vector3d Vector3d.down
staticget

Minus up

Vector3d Vector3d.forward
staticget
Vector3d Vector3d.fwd
staticget
Vector3d Vector3d.left
staticget

Minus right.

double Vector3d.magnitude
get
Vector3d Vector3d.normalized
get
Vector3d Vector3d.one
staticget
Vector3d Vector3d.right
staticget
double Vector3d.sqrMagnitude
get
double Vector3d.this[int index]
getset
Vector3d Vector3d.up
staticget
Vector3d Vector3d.xzy
get

Returs a new Vector3d with the y and z coordinates swapped?

Vector3d Vector3d.zero
staticget

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