diff --git a/src/Struct/Point.bf b/src/Struct/Point.bf index ad70ac5..3c90094 100644 --- a/src/Struct/Point.bf +++ b/src/Struct/Point.bf @@ -38,6 +38,9 @@ namespace Strawberry return .(-Y, X); } + public float Length => Math.Sqrt(LengthSquared); + public int LengthSquared => X * X + Y * Y; + public override void ToString(String strBuffer) { strBuffer.Set("Point [ "); diff --git a/src/Struct/Vector.bf b/src/Struct/Vector.bf index c8dd245..43de4b5 100644 --- a/src/Struct/Vector.bf +++ b/src/Struct/Vector.bf @@ -32,23 +32,8 @@ namespace Strawberry return .(-Y, X); } - public float Length - { - [Inline] - get - { - return Math.Sqrt(LengthSquared); - } - } - - public float LengthSquared - { - [Inline] - get - { - return X * X + Y * Y; - } - } + public float Length => Math.Sqrt(LengthSquared); + public float LengthSquared => X * X + Y * Y; [Inline] public Point Round()