-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathVector3.cs
More file actions
33 lines (29 loc) · 759 Bytes
/
Vector3.cs
File metadata and controls
33 lines (29 loc) · 759 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
29
30
31
32
33
namespace OrthoGraph
{
public class Vector3
{
public float X { get; private set; }
public float Y { get; private set; }
public float Z { get; private set; }
public Vector3()
{
X = 0;
Y = 0;
Z = 0;
}
public Vector3(float x, float y, float z)
{
X = x;
Y = y;
Z = z;
}
public static Vector3 operator + (Vector3 a, Vector3 b)
{
return new Vector3 { X = a.X + b.X, Y = a.Y + b.Y, Z = a.Z + b.Z };
}
public static Vector3 operator - (Vector3 a, Vector3 b)
{
return new Vector3 { X = a.X - b.X, Y = a.Y - b.Y, Z = a.Z - b.Z};
}
}
}