mirror of
https://github.com/MaddyThorson/StrawberryBF.git
synced 2024-11-28 16:58:56 +08:00
Point and Vector Length/LengthSquared
This commit is contained in:
parent
228295649e
commit
53ab0a7910
|
@ -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 [ ");
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue
Block a user