29 return M.Sqrt(x * x + y * y + z * z);
55 public DVector3(
double newX = 0.0,
double newY = 0.0,
double newZ = 0.0)
68 return new Vector3((
float)x, (
float)y, (
float)z);
79 return (M.Abs(x - v.x) <= e) && (M.Abs(y - v.y) <= e) && (M.Abs(z - v.z) <= e);
99 public void Set(
double xx = 0.0,
double yy = 0.0,
double zz = 0.0)
112 return "(" + x +
", " + y +
", " + z +
")";
123 return a.x * b.x + a.y * b.y + a.z * b.z;
134 return M.Sqrt(a.x * b.x + a.y * b.y + a.z * b.z);
146 double s = M.Max(0, M.Min(t, 1));
147 return a * (1 - s) + b * s;
void Set(double xx=0.0, double yy=0.0, double zz=0.0)
Set the specified x and y.
bool Equals(DVector3 v, double e=0.00005)
Equals the specified v and e.
static double Dot(DVector3 a, DVector3 b)
Dot the specified a and b.
DVector3 normalized
Gets the normalized version of this vector.
static DVector3 Lerp(DVector3 a, DVector3 b, double t)
Lerp the specified a, b and t.
void Normalize()
Normalize this instance.
Vector3 toVector3()
Converts to a Vector3.
double magnitude
Gets the magnitude of the vector.
DVector3(double newX=0.0, double newY=0.0, double newZ=0.0)
Initializes a new instance of the T:DVector3 struct.
static DVector3 operator+(DVector3 a, DVector3 b)
Adds a DVector3 to a DVector3, yielding a new T:DVector3.
override string ToString()
Returns a T:System.String that represents the current T:DVector3.
static DVector3 operator/(DVector3 a, double b)
Computes the division of a and b, yielding a new T:DVector3.
static DVector3 operator*(DVector3 a, double b)
Computes the product of a and b, yielding a new T:DVector3.
static DVector3 operator-(DVector3 a, DVector3 b)
Subtracts a DVector3 from a DVector3, yielding a new T:DVector3.
static double Distance(DVector3 a, DVector3 b)
Distance the specified a and b.