fn contains(circle: &CircleCoordinates, point: &Coordinates) -> bool {
    let mut b_return = false;
    // use Pythagoras theorem to figure out if the given latitude and longitude is within circle for the given radius
    // (x-center_x)^2 + (y - center_y)^2 < radius^2
    let distance = f64::powf(circle.lat - point.lat, 2.0) + f64::powf(circle.lon - point.lon, 2.0);
    if distance <= (f64::powf(circle.rad, 2.0)) {
        b_return = true;
    }
    b_return
}
/// The below function checks if the given coordinates latitude and longitude are inside the fence created with CircleCoordinates
/// for the given radius.
/// It uses Pythagoras theorem to calculate if a given point is within the circular fence created
/// The function the below parameters
/// CircleCoordinates -> contains Coordinates required for creating circular fence
/// Coordinates -> contains coordinates that for which location has to be determined.
/// Returns bool -> True if the coordinates are inside the fence, False if it is outside.
///
The below function checks if the given coordinates latitude and longitude are inside the fence created with CircleCoordinates
for the given radius.
It uses Pythagoras theorem to calculate if a given point is within the circular fence created
The function the below parameters
CircleCoordinates -> contains Coordinates required for creating circular fence
Coordinates -> contains coordinates that for which location has to be determined.
Returns bool -> True if the coordinates are inside the fence, False if it is outside.
The below function checks if the given coordinates latitude and longitude are inside the fence created with CircleCoordinates for the given radius . It uses Pythagoras theorem to calculate if a given point is within the circular fence created The function the below parameters CircleCoordinates - > contains Coordinates required for creating circular fence Coordinates - > contains coordinates that for which location has to be determined . Returns bool - > True if the coordinates are inside the fence False if it is outside .
fn contains(circle: &CircleCoordinates, point: &Coordinates) -> bool {
    let mut b_return = false;
    // use Pythagoras theorem to figure out if the given latitude and longitude is within circle for the given radius
    // (x-center_x)^2 + (y - center_y)^2 < radius^2
    let distance = f64::powf(circle.lat - point.lat, 2.0) + f64::powf(circle.lon - point.lon, 2.0);
    if distance <= (f64::powf(circle.rad, 2.0)) {
        b_return = true;
    }
    b_return
}
fn contains ( circle : & CircleCoordinates , point : & Coordinates ) -> bool { let mut b_return = false ; // use Pythagoras theorem to figure out if the given latitude and longitude is within circle for the given radius // (x-center_x)^2 + (y - center_y)^2 < radius^2 let distance = f64 :: powf ( circle . lat - point . lat , 2.0 ) + f64 :: powf ( circle . lon - point . lon , 2.0 ) ; if distance <= ( f64 :: powf ( circle . rad , 2.0 ) ) { b_return = true ; } b_return }
The below function checks if the given coordinates latitude and longitude are inside the fence created with CircleCoordinates
for the given radius.
The below function checks if the given coordinates latitude and longitude are inside the fence created with CircleCoordinates for the given radius .
circle
&CircleCoordinates
point
&Coordinates
circle
&CircleCoordinates
point
&Coordinates