mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			16 lines
		
	
	
		
			302 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			302 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
class Point {
 | 
						|
  Point(this.x, this.y);
 | 
						|
  distanceTo(Point other) {
 | 
						|
    var dx = x - other.x;
 | 
						|
    var dy = y - other.y;
 | 
						|
    return Math.sqrt(dx * dx + dy * dy);
 | 
						|
  }
 | 
						|
  var x, y;
 | 
						|
}
 | 
						|
 | 
						|
main() {
 | 
						|
  Point p = new Point(2, 3);
 | 
						|
  Point q = new Point(3, 4);
 | 
						|
  print('distance from p to q = ${p.distanceTo(q)}');
 | 
						|
}
 |