2025-02-19 11:04:56 +01:00

30 lines
743 B
C#

#if !UNITY_5_3_OR_NEWER
namespace Passer.LinearAlgebra {
public class Vector3Of<T> {
public T x;
public T y;
public T z;
public Vector3Of(T x, T y, T z) {
this.x = x;
this.y = y;
this.z = z;
}
// public uint magnitude {
// get => (float)Math.Sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
// }
}
public class Vector3Int(int x, int y, int z) : Vector3Of<int>(x, y, z) {
}
public class Vector3Float(float x, float y, float z) : Vector3Of<float>(x, y, z) {
public float magnitude {
get => (float)Math.Sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
}
}
}
#endif