forked from stschake/eveDestiny
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVector3.cs
More file actions
28 lines (24 loc) · 695 Bytes
/
Vector3.cs
File metadata and controls
28 lines (24 loc) · 695 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using System.Runtime.InteropServices;
namespace eveDestiny
{
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct Vector3
{
public double X;
public double Y;
public double Z;
public double DistanceSquare(Vector3 b)
{
return Math.Pow(b.X - X, 2) + Math.Pow(b.Y - Y, 2) + Math.Pow(b.Z - Z, 2);
}
public double Distance(Vector3 b)
{
return Math.Sqrt(DistanceSquare(b));
}
public override string ToString()
{
return "(" + Math.Round(X) + ", " + Math.Round(Y) + ", " + Math.Round(Z) + ")";
}
}
}