fn dist1(p1 : Pt, p2: Pt) -> f32 {
   let xd = p1.x - p2.x;
   let yd = p1.y - p2.y;
   (xd * xd + yd * yd).sqrt()
}
// This works, but may be expensive:
This works, but may be expensive.
This works but may be expensive .
fn dist1(p1 : Pt, p2: Pt) -> f32 {
   let xd = p1.x - p2.x;
   let yd = p1.y - p2.y;
   (xd * xd + yd * yd).sqrt()
}
fn dist1 ( p1 : Pt , p2 : Pt ) -> f32 { let xd = p1 . x - p2 . x ; let yd = p1 . y - p2 . y ; ( xd * xd + yd * yd ) . sqrt ( ) }
This works, but may be expensive:
This works but may be expensive :
p1
Pt
p2
Pt
p1
Pt
p2
Pt