mirror of
				https://github.com/MaddyThorson/StrawberryBF.git
				synced 2025-11-04 01:41:33 +08:00 
			
		
		
		
	Point and Vector Length/LengthSquared
This commit is contained in:
		@ -38,6 +38,9 @@ namespace Strawberry
 | 
				
			|||||||
			return .(-Y, X);
 | 
								return .(-Y, X);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							public float Length => Math.Sqrt(LengthSquared);
 | 
				
			||||||
 | 
							public int LengthSquared => X * X + Y * Y;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		public override void ToString(String strBuffer)
 | 
							public override void ToString(String strBuffer)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			strBuffer.Set("Point [ ");
 | 
								strBuffer.Set("Point [ ");
 | 
				
			||||||
 | 
				
			|||||||
@ -32,23 +32,8 @@ namespace Strawberry
 | 
				
			|||||||
			return .(-Y, X);
 | 
								return .(-Y, X);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		public float Length
 | 
							public float Length => Math.Sqrt(LengthSquared);
 | 
				
			||||||
		{
 | 
							public float LengthSquared => X * X + Y * Y;
 | 
				
			||||||
			[Inline]
 | 
					 | 
				
			||||||
			get
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				return Math.Sqrt(LengthSquared);
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		public float LengthSquared
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			[Inline]
 | 
					 | 
				
			||||||
			get
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				return X * X + Y * Y;
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		[Inline]
 | 
							[Inline]
 | 
				
			||||||
		public Point Round()
 | 
							public Point Round()
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user