using UnityEngine; namespace Assets.GAMA.net.Domain { public struct GamaPoint { public double X { get; set; } public double Y { get; set; } public double Z { get; set; } public GamaPoint Scale(Vector3 scale) { X *= scale.x; Y *= scale.y; Z *= scale.z; return this; } public GamaPoint Displace(Vector3 displacement) { X += displacement.x; Y += displacement.y; Z += displacement.z; return this; } public GamaPoint Rotate(float angle) { float cos = Mathf.Cos(angle); float sin = Mathf.Sin(angle); double x2 = X * cos - Y * sin; double y2 = X * sin + Y * cos; X = x2; Y = y2; return this; } override public string ToString() { return $"({X},{Y},{Z})"; } public static bool operator ==(GamaPoint pointA, GamaPoint pointB) { return pointA.X == pointB.X && pointA.Y == pointB.Y && pointA.Z == pointB.Z; } public static bool operator !=(GamaPoint pointA, GamaPoint pointB) { return !(pointA == pointB); } } }