pub fn contains(triangle: &[Coordinates], point: &Coordinates) -> bool {
    let mut b_contains = false;
    if triangle.len() == 3 {
        let side1 = &triangle[0];
        let side2 = &triangle[1];
        let side3 = &triangle[2];
        //Calculate area of triangle ABC
        let area_abc = get_area(side1, side2, side3);
        println!("area {:?}", area_abc);
        //Calculate area of triangle PBC
        let area_pbc = get_area(point, side2, side3);
        //Calculate area of triangle PAC
        let area_pac = get_area(side1, point, side3);
        //Calculate area of triangle PAB
        let area_pab = get_area(side1, side2, point);
        // Check if sum of area_pbc, area_pac and area_pab  is equal to area_abc
        if (area_abc - (area_pab + area_pac + area_pbc)).abs() == 0.0 {
            b_contains = true;
        }
    }
    b_contains
}
///
/// This method checks if a particular coordinate is within the triangular fence.
/// This method  verifies if a line drawn from a point is intersecting
/// within the boundaries of the created fence.
/// It returns boolean true if the coordinates are within the fence and
/// false if the coordinates are outside the fence.
///
This method checks if a particular coordinate is within the triangular fence.
This method  verifies if a line drawn from a point is intersecting
within the boundaries of the created fence.
It returns boolean true if the coordinates are within the fence and
false if the coordinates are outside the fence.
This method checks if a particular coordinate is within the triangular fence . This method verifies if a line drawn from a point is intersecting within the boundaries of the created fence . It returns boolean true if the coordinates are within the fence and false if the coordinates are outside the fence .
pub fn contains(triangle: &[Coordinates], point: &Coordinates) -> bool {
    let mut b_contains = false;
    if triangle.len() == 3 {
        let side1 = &triangle[0];
        let side2 = &triangle[1];
        let side3 = &triangle[2];
        //Calculate area of triangle ABC
        let area_abc = get_area(side1, side2, side3);
        println!("area {:?}", area_abc);
        //Calculate area of triangle PBC
        let area_pbc = get_area(point, side2, side3);
        //Calculate area of triangle PAC
        let area_pac = get_area(side1, point, side3);
        //Calculate area of triangle PAB
        let area_pab = get_area(side1, side2, point);
        // Check if sum of area_pbc, area_pac and area_pab  is equal to area_abc
        if (area_abc - (area_pab + area_pac + area_pbc)).abs() == 0.0 {
            b_contains = true;
        }
    }
    b_contains
}
pub fn contains ( triangle : & [ Coordinates ] , point : & Coordinates ) -> bool { let mut b_contains = false ; if triangle . len ( ) == 3 { let side1 = & triangle [ 0 ] ; let side2 = & triangle [ 1 ] ; let side3 = & triangle [ 2 ] ; //Calculate area of triangle ABC let area_abc = get_area ( side1 , side2 , side3 ) ; println ! ( " " area_abc ) ; //Calculate area of triangle PBC let area_pbc = get_area ( point , side2 , side3 ) ; //Calculate area of triangle PAC let area_pac = get_area ( side1 , point , side3 ) ; //Calculate area of triangle PAB let area_pab = get_area ( side1 , side2 , point ) ; // Check if sum of area_pbc, area_pac and area_pab  is equal to area_abc if ( area_abc - ( area_pab + area_pac + area_pbc ) ) . abs ( ) == 0.0 { b_contains = true ; } } b_contains }
This method checks if a particular coordinate is within the triangular fence.
This method checks if a particular coordinate is within the triangular fence .
triangle
&[Coordinates]
point
&Coordinates
triangle
&[Coordinates]
point
&Coordinates